Commit 71126280 authored by Marius Rackwitz's avatar Marius Rackwitz

[Spec] Test Validator#podfile_from_spec

parent e4d56d54
...@@ -301,12 +301,31 @@ module Pod ...@@ -301,12 +301,31 @@ module Pod
podfile = validator.send(:perform_extensive_analysis, validator.spec) podfile = validator.send(:perform_extensive_analysis, validator.spec)
end end
it 'respects the local option' do describe '#podfile_from_spec' do
sut = Validator.new(podspec_path, SourcesManager.master.map(&:url)) before do
sut.stubs(:validate_url) @sut = Validator.new(podspec_path, SourcesManager.master.map(&:url))
podfile = sut.send(:podfile_from_spec, :ios, '5.0') @sut.stubs(:validate_url)
deployment_target = podfile.target_definitions['Pods'].platform.deployment_target end
deployment_target.to_s.should == '5.0'
it 'configures the deployment target' do
podfile = @sut.send(:podfile_from_spec, :ios, '5.0')
target_definition = podfile.target_definitions['Pods']
platform = target_definition.platform
platform.symbolic_name.should == :ios
platform.deployment_target.to_s.should == '5.0'
end
it 'includes the use_frameworks! directive' do
podfile = @sut.send(:podfile_from_spec, :ios, '5.0', true)
target_definition = podfile.target_definitions['Pods']
target_definition.uses_frameworks?.should == true
end
it 'includes the use_frameworks!(false) directive' do
podfile = @sut.send(:podfile_from_spec, :ios, '5.0', false)
target_definition = podfile.target_definitions['Pods']
(!!target_definition.uses_frameworks?).should == false
end
end end
it 'repects the source_urls parameter' do it 'repects the source_urls parameter' 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