[rspec-devel] [ rspec-Feature Requests-7536 ] Mock expectations can be called more than once and ordered

noreply at rubyforge.org noreply at rubyforge.org
Sun Nov 18 21:04:20 EST 2007


Feature Requests item #7536, was opened at 2007-01-02 23:26
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=7536&group_id=797

Category: None
Group: None
>Status: Closed
Priority: 3
Submitted By: Brian Takita (btakita)
Assigned to: Nobody (None)
Summary: Mock expectations can be called more than once and ordered

Initial Comment:
the_mock = mock("the_mock")
the_mock.should_receive(:foo).ordered
the_mock.should_receive(:bar).ordered
the_mock.should_receive(:foo).ordered
the_mock.should_receive(:baz).ordered


----------------------------------------------------------------------

Comment By: Chad Humphries (spicycode)
Date: 2007-11-19 02:03

Message:
Moved to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/30-7536-mock-expectations-can-be-called-more-than-once-and-ordered#ticket-30-2

----------------------------------------------------------------------

Comment By: Brian Takita (btakita)
Date: 2007-01-05 07:13

Message:
require "rubygems"
require "spec"

context "An Ordered mock" do
  specify "should allow a method to be ordered twice" do
    the_mock = mock("the_mock")
    the_mock.should_receive(:foo).ordered
    the_mock.should_receive(:bar).ordered
    the_mock.should_receive(:foo).ordered
    the_mock.should_receive(:baz).ordered

    the_mock.foo
    the_mock.bar
    the_mock.foo
    the_mock.baz
  end
end


----------------------------------------------------------------------

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-01-03 00:17

Message:
Do you have a failing spec?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=7536&group_id=797


More information about the rspec-devel mailing list