[rspec-users] Testing on enter state

Ramon Tayag ramon.tayag at gmail.com
Wed Nov 19 09:28:09 EST 2008


Ahh.. yes, you do.  Thanks a lot!  That definitely answers my question.

Ramon Tayag

On Wed, Nov 19, 2008 at 10:01 PM, David Chelimsky <dchelimsky at gmail.com> wrote:
> I didn't mean make the methods public. I meant use the public API.
>
> For example, this:
>
> describe Dog do
>  it "should increase its heart rate when the postman arrives" do
>    dog = Dog.new
>    lambda {dog.see Postman.new}.should change{dog.heartrate}.by(10)
>  end
> end
>
> rather than this:
>
> describe Dog do
>  it "should transition to an agitated state when the postman arrives" do
>    dog = Dog.new
>    dog.should_receive(:transition_to).with(:agitated)
>    dog.see Postman.new
>  end
> end
>
> Make sense?


More information about the rspec-users mailing list