Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Provide a human readable format when inspecting an RSpec::Core::Example #2006

Merged
merged 1 commit into from
Jun 23, 2015

Conversation

gavingmiller
Copy link
Contributor

To address issue #1922

def inspect
"#<#{self.class.name} #{description.inspect}>"
end
alias to_s inspect
Copy link
Member

Choose a reason for hiding this comment

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

Is there a spec for the to_s alias? I didn't see one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is now! 😉

@myronmarston
Copy link
Member

Thanks, @gavingmiller! Looking good except for the lack of test coverage for the to_s alias. It'd also be nice to have this all squashed into one commit.

Fixes rspec#1922 and provides a nicer description when #inspect or #to_s is
called on an RSpec::Core::Example.
@gavingmiller
Copy link
Contributor Author

@myronmarston changes made - let me know if there's anything else.

myronmarston added a commit that referenced this pull request Jun 23, 2015
Provide a human readable format when inspecting an RSpec::Core::Example
@myronmarston myronmarston merged commit aebf968 into rspec:master Jun 23, 2015
@myronmarston
Copy link
Member

Thanks @gavingmiller!

MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
Provide a human readable format when inspecting an RSpec::Core::Example
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants