[rspec-users] how can this pass?

David Chelimsky dchelimsky at gmail.com
Mon Feb 9 09:26:30 EST 2009


On Mon, Feb 9, 2009 at 6:22 AM, Matías Flores <mflores at atlanware.com> wrote:
>
> 2009/2/9 Mark Wilden <mark at mwilden.com>
>>
>> On Sun, Feb 8, 2009 at 6:09 PM, Matías Flores <mflores at atlanware.com>
>> wrote:
>> >
>> > You can find more info at
>> > http://rspec.info/documentation/mocks/message_expectations.html.
>> >
>>
>> On that page, I found this example of using a computed return value
>> with an expectation:
>>
>> my_mock.should_receive(:msg).with(:numeric, :numeric) once.and_return
>> {|a, b| a + b}
>>
>> I'm not familiar with :numeric. Does it mean what it looks like it means?
>
> That example is a bit outdated.

And now fixed: http://rspec.info/documentation/mocks/message_expectations.html

> Use of symbols as mock argument constraints
> such as :numeric, :string, :anything, etc, are deprecated.
>
> The expectation above should be replaced with:
>
> my_mock.should_receive(:msg).with(an_instance_of(Numeric),
> an_instance_of(Numeric)).once.and_return {|a, b| a + b}
>
> Regards,
> Matías
>
>>
>> ///ark
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list