Commit 20056d29 authored by Joshua Kalpin's avatar Joshua Kalpin

Merge pull request #1756 from carsonmcdonald/moreliblintspecs

Add test for lint failures
parents f1b648c4 bc4b8a90
...@@ -27,6 +27,41 @@ module Pod ...@@ -27,6 +27,41 @@ module Pod
UI.output.should.include "passed validation" UI.output.should.include "passed validation"
end end
end end
it "fails to lint a broken spec file and cleans up" do
Dir.chdir(temporary_directory) do
open(temporary_directory + 'Broken.podspec', 'w') { |f|
f << 'Pod::Spec.new do |spec|'
f << "spec.name = 'Broken'"
f << 'end'
}
tmp_validator = Validator.new('Broken.podspec')
lint_path = tmp_validator.validation_dir
lambda { run_command('lib', 'lint', 'Broken.podspec') }.should.raise Pod::Informative
UI.output.should.include "Missing required attribute"
lint_path.exist?.should == false
end
end
it "fails to lint a broken spec file and leaves lint directory" do
Dir.chdir(temporary_directory) do
open(temporary_directory + 'Broken.podspec', 'w') { |f|
f << 'Pod::Spec.new do |spec|'
f << "spec.name = 'Broken'"
f << 'end'
}
lambda { run_command('lib', 'lint', 'Broken.podspec', '--no-clean') }.should.raise Pod::Informative
UI.output.should.include "Pods project available at"
UI.output.should.include "Missing required attribute"
lint_dir = UI.output[/.*Pods project available at `(.*)` for inspection./,1]
Pathname.new(lint_dir).exist?.should == true
end
end
end end
describe Command::Lib do describe Command::Lib do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment