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

Merged
merged 2 commits into from Aug 11, 2014

Projects

None yet

5 participants

@luisdelarosa

... 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.

After further investigation, this looks like it will have to be fixed in Core, probably in dependency. I think it would still be good to have these tests at the CocoaPods level, though.

@luisdelarosa luisdelarosa Added 8 tests for issue #1489, one of which is failing. The failing t…
…est 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.
8d077cd
@alloy alloy self-assigned this Mar 30, 2014
@houndci-bot houndci-bot commented on the diff Apr 17, 2014
spec/unit/resolver_spec.rb
@@ -192,7 +192,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
+
@houndci-bot
houndci-bot Apr 17, 2014

Trailing whitespace detected.

@houndci-bot houndci-bot commented on the diff Apr 17, 2014
spec/unit/resolver_spec.rb
+ 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
+
@houndci-bot
houndci-bot Apr 17, 2014

Trailing whitespace detected.

@houndci-bot houndci-bot commented on the diff Apr 17, 2014
spec/unit/resolver_spec.rb
+ 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
+
@houndci-bot
houndci-bot Apr 17, 2014

Trailing whitespace detected.

@houndci-bot houndci-bot commented on the diff Apr 17, 2014
spec/unit/resolver_spec.rb
+ # 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
+
@houndci-bot
houndci-bot Apr 17, 2014

Trailing whitespace detected.

@houndci-bot houndci-bot commented on the diff Apr 17, 2014
spec/unit/resolver_spec.rb
+ 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
+
@houndci-bot
houndci-bot Apr 17, 2014

Trailing whitespace detected.

@fabiopelosin
CocoaPods member

Usually I don't like to have extensive tests in the modules (classes) which are not implementing the related logic. I.e. I would have minimal tests here to ensure that the Resolver is using correctly the dependencies in Core and extensively test there. However I'm leaving this call to @segiddins as he is the CocoaPods Resolver chief.

@segiddins
CocoaPods member

@irrationalfab these are end-to-end tests, and as such I think they belong exactly where they are. I will merge shortly, but I'm quickly looking into getting that one failing test to pass

@segiddins
CocoaPods member

Actually, that failing test probably won't be fixed until ~November, so what should I do about it? /cc @alloy

@fabiopelosin
CocoaPods member

I vote to disable it and merge the PR. Keeping it here is not providing any help.

@segiddins
CocoaPods member

Bacon doesn't seem to have a way to disable specs?

@fabiopelosin fabiopelosin reopened this Aug 11, 2014
@fabiopelosin fabiopelosin merged commit d6dd337 into CocoaPods:master Aug 11, 2014

1 check failed

Details continuous-integration/travis-ci The Travis CI build failed
@fabiopelosin
CocoaPods member

@segiddins: we can use xit (instead of it) this is a feature ported from Rspec via https://github.com/irrationalfab/PrettyBacon

@fabiopelosin
CocoaPods member

See 6fea5d4

@fabiopelosin
CocoaPods member

@luisdelarosa thanks for helping with the specs. You can't immagine how much I appreciate this kind of contributions 🍷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment