Commit 4b4ff758 authored by Ben Asher's avatar Ben Asher

added more specs

parent c325e4be
...@@ -328,7 +328,7 @@ module Pod ...@@ -328,7 +328,7 @@ module Pod
target_definitions.each do |target_definition| target_definitions.each do |target_definition|
check_prop.call(host_target_definition, target_definition, :platform, 'do not use the same platform') check_prop.call(host_target_definition, target_definition, :platform, 'do not use the same platform')
check_prop.call(host_target_definition, target_definition, :uses_frameworks?, 'do not both set use_frameworks!') check_prop.call(host_target_definition, target_definition, :uses_frameworks?, 'do not both set use_frameworks!')
check_prop.call(host_target_definition, target_definition, :swift_version, 'do not both use the same Swift version') check_prop.call(host_target_definition, target_definition, :swift_version, 'do not use the same Swift version')
end end
end end
......
...@@ -785,6 +785,51 @@ module Pod ...@@ -785,6 +785,51 @@ module Pod
analyzer.analyze analyzer.analyze
end.message.should.match /Sample Extensions Project \(false\) and Today Extension \(true\) do not both set use_frameworks!\./ end.message.should.match /Sample Extensions Project \(false\) and Today Extension \(true\) do not both set use_frameworks!\./
end end
it 'raises when the extension and host target use different swift versions' do
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
platform :ios, '8.0'
use_frameworks!
project 'Sample Extensions Project/Sample Extensions Project'
target 'Sample Extensions Project' do
pod 'JSONKit', '1.4'
end
target 'Today Extension' do
pod 'monkey'
end
end
podfile.target_definitions['Sample Extensions Project'].stubs(:swift_version).returns('2.3')
podfile.target_definitions['Today Extension'].stubs(:swift_version).returns('3.0')
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
should.raise Informative do
analyzer.analyze
end.message.should.match /Sample Extensions Project \(2\.3\) and Today Extension \(3\.0\) do not use the same Swift version\./
end
it 'raises when the extension and host target use different platforms' do
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
platform :ios, '8.0'
use_frameworks!
project 'Sample Extensions Project/Sample Extensions Project'
target 'Sample Extensions Project' do
pod 'JSONKit', '1.4'
end
target 'Today Extension' do
pod 'monkey'
end
end
podfile.target_definitions['Sample Extensions Project'].stubs(:platform).returns(Platform.new(:osx, '10.6'))
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
should.raise Informative do
analyzer.analyze
end.message.should.match /Sample Extensions Project \(OS X 10\.6\) and Today Extension \(iOS 8\.0\) do not use the same platform\./
end
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