[rspec-users] [Mock]How do I check order of method argument ?
niku at niku.name
Fri Dec 17 22:19:35 EST 2010
My question was solved by David's answer.
Thank you David!
On Sat, Dec 18, 2010 at 12:44 AM, David Chelimsky <dchelimsky at gmail.com> wrote:
> On Dec 17, 2010, at 8:12 AM, niku -E:) wrote:
>> My name is niku.
>> I'm using rspec 2.2.1
>> /tmp% rspec --version
>> I tested http://gist.github.com/744935 and passed.
>> /tmp% rspec stdout_spec.rb
>> Finished in 0.00105 seconds
>> 2 examples, 0 failures
>> But I expected test fail.
>> Because It's wrong order that argument of 'write' method.
> Message expectations are not constrained by order unless you explicitly tell them to be. This is documented for rspec-1 here: http://rspec.info/documentation/mocks/message_expectations.html. The docs for rspec-mocks-2 don't have this yet, but will soon.
> Basically, do this instead.
> it "puts 'foo' and 'bar'" do
> mock = double("stdout")
> $stdout = mock
> puts "foo"
> puts "bar"
>> How do I check order of argument ?
>> rspec-users mailing list
>> rspec-users at rubyforge.org
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users