-
-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Current behaviour:
m = mock_model(Transaction)
m.to_s # Returns something like Transaction_#<RSpec::ExampleGroups::0x00564be9720728>
I would like to_s
to also show what is stubbed inside that model, so that the spec is easier to read. For example:
m = mock_model(Transaction, type: :transfer)
m.to_s # Transaction(type: :transfer) #<RSpec::ExampleGroups::0x00564be9720728>
it { is_expected.to be_able_to(:read, mock_model(Transaction, type: :transfer)) }
# Output: It should be able to read Transaction(type: :transfer) #<RSpec::ExampleGroups::0x00564be9720728>
It will look similar to what ActiveRecord does. What do you think?
Darhazer
Metadata
Metadata
Assignees
Labels
No labels