Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add success and fail to command response #10

Merged
merged 1 commit into from
May 24, 2014

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented May 2, 2014

No description provided.

exit_status == 0
end

def fail?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbrock Not sure I like the name .fail?...it doesn't mix with .success? (I would expect .fail? to align with .succeed?). I'm thinking .failure? is a better name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool.

I like the methods succeed? and fail? or succeeded? failed?

This is to make specs read better

expect(x).to be_success
expect(x).to be_failure

Hmm, maybe if we could:

expect(x).to have_succeeded
expect(x).to have_failed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even clearer would be

expect(x).to succeed
expect(x).to fail

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll play.

be_success is automatically added.
Maybe there are some other auto matchers that have better wording

@Fryguy
Copy link
Member

Fryguy commented May 23, 2014

As far as Travis goes, I think I have to change the whole thing to go against 2.1.1, so ignore the failures.

@kbrock
Copy link
Member Author

kbrock commented May 23, 2014

only ref I have found is the predicates listed at rspec matchers.

expect(described_class.new("c", "o", "e", 0)).to be_success ==> .success?
expect(described_class.new("c", "o", "e", 0)).to be_a_success ==> .success?
expect(described_class.new("c", "o", "e", 0)).to have_success ==> .has_success?
expect(described_class.new("c", "o", "e", 0)).to has_success ==> .has_success?

be_a_success may be the best one here (without writing a matcher).

@kbrock
Copy link
Member Author

kbrock commented May 23, 2014

@chessbyte expect(cmd_response).to be_a_success ?

@Fryguy
Copy link
Member

Fryguy commented May 23, 2014

Yes, be_a_success and be_a_failure read much nicer.

@cfme-bot
Copy link
Member

Checked commit kbrock@7620666 with rubocop 0.21.0
2 files checked, 0 offenses detected
Everything looks good. 🍪

Fryguy added a commit that referenced this pull request May 24, 2014
add success and fail to command response
@Fryguy Fryguy merged commit f9e899b into ManageIQ:master May 24, 2014
@kbrock kbrock deleted the command_success branch May 24, 2014 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants