Commit 8d077cd5 authored by Luis de la Rosa's avatar Luis de la Rosa

Added 8 tests for issue #1489, one of which is failing. The failing test…

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.
parent 621a85fb
......@@ -192,6 +192,108 @@ 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
#-------------------------------------------------------------------------#
......
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