Commit ff2be005 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'master' of github.com:luisdelarosa/CocoaPods into luisdelarosa-master

* 'master' of github.com:luisdelarosa/CocoaPods:
  Added 8 tests for issue #1489, one of which is failing. The failing test reproduces the issue that @jomnius reported with the < version operator. One of the passing tests checks the question that @alloy asked about using ~> with a pre-release version. The other passing tests verify correct behavior with the other version operators when dealing with pre-release versions.
parents cadd89f0 d6dd337b
......@@ -195,7 +195,109 @@ module Pod
end
end
# assumes that there are pods for AFNetworking at both version 1.0 and 1.0RC3
it "resolves explicitly requested pre-release versions" do
@podfile = Podfile.new do
platform :ios, '6.0'
pod 'AFNetworking', '1.0RC3'
end
resolver = Resolver.new(config.sandbox, @podfile)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should == ["AFNetworking (1.0RC3)"]
end
# assumes that there are pods for AFNetworking at versions 1.0, 1.0RC3 and 1.2.0
it "resolves to latest minor version even when explicitly requesting pre-release versions when using ~>" do
@podfile = Podfile.new do
platform :ios, '6.0'
pod 'AFNetworking', '~> 1.0RC3'
end
resolver = Resolver.new(config.sandbox, @podfile)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should != ["AFNetworking (1.0RC3)"]
specs.should == ["AFNetworking (1.2.0)"]
end
# assumes that there are pods for AFNetworking at both version 1.0 and 1.0RC3
it "does not resolve to a pre-release version implicitly when matching exact version" do
@podfile = Podfile.new do
platform :ios, '6.0'
pod 'AFNetworking', '1.0'
end
resolver = Resolver.new(config.sandbox, @podfile)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should != ["AFNetworking (1.0RC3)"]
specs.should == ["AFNetworking (1.0)"]
end
# assumes that there are pods for AFNetworking at both version 0.10.1 and 1.0RC3
it "does not resolve to a pre-release version implicitly when using <" do
@podfile = Podfile.new do
platform :ios, '6.0'
pod 'AFNetworking', '< 1.0'
end
resolver = Resolver.new(config.sandbox, @podfile)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should != ["AFNetworking (1.0RC3)"]
specs.should == ["AFNetworking (0.10.1)"]
end
# assumes that there are pods for AFNetworking at both version 1.0 and 1.0RC3
it "does not resolve to a pre-release version implicitly when using <=" do
@podfile = Podfile.new do
platform :ios, '6.0'
pod 'AFNetworking', '<= 1.0'
end
resolver = Resolver.new(config.sandbox, @podfile)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should != ["AFNetworking (1.0RC3)"]
specs.should == ["AFNetworking (1.0)"]
end
# assumes that there are pods for AFNetworking at versions 1.0, 1.0RC3 and 1.2.0
it "does not resolve to a pre-release version implicitly when using >" do
@podfile = Podfile.new do
platform :ios, '6.0'
pod 'AFNetworking', '> 1.0'
end
resolver = Resolver.new(config.sandbox, @podfile)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should != ["AFNetworking (1.0RC3)"]
specs.should == ["AFNetworking (1.2.0)"]
end
# assumes that there are pods for AFNetworking at versions 1.0, 1.0RC3 and 1.2.0
it "does not resolve to a pre-release version implicitly when using >=" do
@podfile = Podfile.new do
platform :ios, '6.0'
pod 'AFNetworking', '>= 1.0'
end
resolver = Resolver.new(config.sandbox, @podfile)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should != ["AFNetworking (1.0RC3)"]
specs.should == ["AFNetworking (1.2.0)"]
end
# assumes that there are pods for AFNetworking at versions 1.0, 1.0RC3 and 1.2.0
it "does not resolve to a pre-release version implicitly when using ~>" do
@podfile = Podfile.new do
platform :ios, '6.0'
pod 'AFNetworking', '~> 1.0'
end
resolver = Resolver.new(config.sandbox, @podfile)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should != ["AFNetworking (1.0RC3)"]
specs.should == ["AFNetworking (1.2.0)"]
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