Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add more test coverage for the spec cat command. #1665

Merged
merged 1 commit into from Dec 11, 2013

Conversation

Projects
None yet
3 participants
Contributor

carsonmcdonald commented Dec 9, 2013

Add coverage for spec cat and spec cat --show-all

@alloy alloy and 1 other commented on an outdated diff Dec 9, 2013

spec/functional/command/spec_spec.rb
@@ -205,6 +205,17 @@ def it_should_check_for_ambiguity(command)
describe Command::Spec::Cat do
it_should_check_for_existence("cat")
it_should_check_for_ambiguity("cat")
+
+ it "cats the given podspec" do
+ lambda { command('spec', 'cat', 'AFNetworking').run }.should.not.raise
+ UI.output.should.include "s.name = 'AFNetworking'"
@alloy

alloy Dec 9, 2013

Owner

Could this not simply assert that the full spec was printed, instead of checking just a partial include?

@carsonmcdonald

carsonmcdonald Dec 9, 2013

Contributor

@alloy I believe so, I could just test that the md5 hash is what is expected. Would that be better?

@alloy

alloy Dec 11, 2013

Owner

@carsonmcdonald That would be an option, but I’m not sure that makes the test communicate the intent very well. How about UI.output.should.include fixture("spec-repos/master/AFNetworking/#{version}/AFNetworking.podspec") ?

@carsonmcdonald

carsonmcdonald Dec 11, 2013

Contributor

@alloy Thanks for pointing that out. I didn't dig deep enough to understand where the podspec was coming from. I'll make the change to both tests.

Owner

fabiopelosin commented Dec 11, 2013

Looks great! Thanks!

@fabiopelosin fabiopelosin added a commit that referenced this pull request Dec 11, 2013

@fabiopelosin fabiopelosin Merge pull request #1665 from carsonmcdonald/morecatcoverage
Add more test coverage for the spec cat command.
9545c38

@fabiopelosin fabiopelosin merged commit 9545c38 into CocoaPods:master Dec 11, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment