Commit d4f63d95 authored by Samuel Giddins's avatar Samuel Giddins

[Validator] Update specs for the app import

parent ea1a7635
...@@ -104,7 +104,7 @@ module Pod ...@@ -104,7 +104,7 @@ module Pod
run_command('lib', 'lint', 'Broken.podspec', '--no-clean') run_command('lib', 'lint', 'Broken.podspec', '--no-clean')
end end
UI.output.should.include 'Missing required attribute' UI.output.should.include 'Missing required attribute'
UI.output.should.include 'Pods project available at' UI.output.should.include 'Pods workspace available at'
end end
end end
......
...@@ -130,6 +130,7 @@ module Pod ...@@ -130,6 +130,7 @@ module Pod
Installer.any_instance.stubs(:aggregate_targets).returns([]) Installer.any_instance.stubs(:aggregate_targets).returns([])
Installer.any_instance.stubs(:pod_targets).returns([]) Installer.any_instance.stubs(:pod_targets).returns([])
Validator.any_instance.stubs(:install_pod) Validator.any_instance.stubs(:install_pod)
Validator.any_instance.stubs(:add_app_project_import)
Validator.any_instance.stubs(:check_file_patterns) Validator.any_instance.stubs(:check_file_patterns)
Validator.any_instance.stubs(:validated?).returns(true) Validator.any_instance.stubs(:validated?).returns(true)
Validator.any_instance.stubs(:validate_url) Validator.any_instance.stubs(:validate_url)
......
...@@ -102,6 +102,7 @@ module Pod ...@@ -102,6 +102,7 @@ module Pod
@validator.stubs(:download_pod) @validator.stubs(:download_pod)
@validator.stubs(:check_file_patterns) @validator.stubs(:check_file_patterns)
@validator.stubs(:install_pod) @validator.stubs(:install_pod)
@validator.stubs(:add_app_project_import)
@validator.stubs(:build_pod) @validator.stubs(:build_pod)
@validator.stubs(:tear_down_validation_environment) @validator.stubs(:tear_down_validation_environment)
WebMock::API.stub_request(:head, /not-found/).to_return(:status => 404) WebMock::API.stub_request(:head, /not-found/).to_return(:status => 404)
...@@ -128,7 +129,7 @@ module Pod ...@@ -128,7 +129,7 @@ module Pod
WebMock::API.stub_request(:head, /found/).to_return(:status => 200) WebMock::API.stub_request(:head, /found/).to_return(:status => 200)
Specification.any_instance.stubs(:homepage).returns('http://banana-corp.local/redirect/') Specification.any_instance.stubs(:homepage).returns('http://banana-corp.local/redirect/')
@validator.validate @validator.validate
@validator.results.length.should.equal 0 @validator.results.should.be.empty
end end
it 'does not fail if the homepage does not support HEAD' do it 'does not fail if the homepage does not support HEAD' do
...@@ -136,7 +137,7 @@ module Pod ...@@ -136,7 +137,7 @@ module Pod
WebMock::API.stub_request(:get, /page/).to_return(:status => 200) WebMock::API.stub_request(:get, /page/).to_return(:status => 200)
Specification.any_instance.stubs(:homepage).returns('http://banana-corp.local/page/') Specification.any_instance.stubs(:homepage).returns('http://banana-corp.local/page/')
@validator.validate @validator.validate
@validator.results.length.should.equal 0 @validator.results.should.be.empty
end end
it 'does not fail if the homepage errors on HEAD' do it 'does not fail if the homepage errors on HEAD' do
...@@ -144,7 +145,7 @@ module Pod ...@@ -144,7 +145,7 @@ module Pod
WebMock::API.stub_request(:get, /page/).to_return(:status => 200) WebMock::API.stub_request(:get, /page/).to_return(:status => 200)
Specification.any_instance.stubs(:homepage).returns('http://banana-corp.local/page/') Specification.any_instance.stubs(:homepage).returns('http://banana-corp.local/page/')
@validator.validate @validator.validate
@validator.results.length.should.equal 0 @validator.results.should.be.empty
end end
it 'does not follow redirects infinitely' do it 'does not follow redirects infinitely' do
...@@ -166,7 +167,7 @@ module Pod ...@@ -166,7 +167,7 @@ module Pod
Specification.any_instance.stubs(:homepage).returns( Specification.any_instance.stubs(:homepage).returns(
'http://banana-corp.local/redirect') 'http://banana-corp.local/redirect')
@validator.validate @validator.validate
@validator.results.length.should.equal 0 @validator.results.should.be.empty
end end
end end
...@@ -300,8 +301,8 @@ module Pod ...@@ -300,8 +301,8 @@ module Pod
validator.stubs(:validate_url) validator.stubs(:validate_url)
validator.stubs(:validate_screenshots) validator.stubs(:validate_screenshots)
validator.stubs(:check_file_patterns) validator.stubs(:check_file_patterns)
validator.stubs(:check_file_patterns)
validator.stubs(:install_pod) validator.stubs(:install_pod)
validator.stubs(:add_app_project_import)
%i(prepare resolve_dependencies download_dependencies).each do |m| %i(prepare resolve_dependencies download_dependencies).each do |m|
Installer.any_instance.stubs(m) Installer.any_instance.stubs(m)
end end
...@@ -538,6 +539,7 @@ module Pod ...@@ -538,6 +539,7 @@ module Pod
@validator.stubs(:validate_screenshots) @validator.stubs(:validate_screenshots)
@validator.stubs(:check_file_patterns) @validator.stubs(:check_file_patterns)
@validator.stubs(:install_pod) @validator.stubs(:install_pod)
@validator.stubs(:add_app_project_import)
%i(prepare resolve_dependencies download_dependencies).each do |m| %i(prepare resolve_dependencies download_dependencies).each do |m|
Installer.any_instance.stubs(m) Installer.any_instance.stubs(m)
end end
......
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