1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/spec
Elliot Winkler 29b144651b Reword failure message for #delegate_method
Currently it says something like this:

    Expected Person#name to delegate to Person#company as #company_name

However, this isn't in line with proper terminology. It doesn't make
sense to say that one method delegates to another; you delegate a method
to another object. So now it says:

    Expected Person to delegate #name to #company object as #company_name

Additionally, we now clarify that #company (in this example) -- or
rather the object returned by #company -- is the delegate object, and if
this object never receives any method calls we say so. Instead of this:

    Calls on Person#company: ...

we say:

    Method calls sent to Person#company: ...

Furthermore, the description (which is shown as the tests are run) was
not correct when `delegate_method` was used against a class rather than
an instance. As an example, the following code:

    it { expect(Person).to delegate_method(:name).to(:company) }

would print out as

    should delegate #name to #company object

and now it prints out as

    should delegate .name to .company object
2014-09-03 00:28:24 -06:00
..
shoulda/matchers Reword failure message for #delegate_method 2014-09-03 00:28:24 -06:00
support Create the define_enum_for matcher 2014-08-26 14:44:27 -06:00
warnings_spy Remove all Ruby-emitted warnings 2014-07-18 18:00:08 -06:00
report_warnings.rb Remove all Ruby-emitted warnings 2014-07-18 18:00:08 -06:00
spec_helper.rb Using RSpec 3 for development. 2014-08-14 12:16:54 -04:00
warnings_spy.rb Remove all Ruby-emitted warnings 2014-07-18 18:00:08 -06:00