search for: testdog

Displaying 1 result from an estimated 1 matches for "testdog".

Did you mean: testdom
2007 Apr 16
0
Fwd: ANN: FlexMock 0.6.0 Released
...f happy @tail.wag end end To test the +Dog+ class without a real +Tail+ object (perhaps because real +Tail+ objects activate servos in some robotic equipment), you can do something like this: require ''test/unit'' require ''flexmock/test_unit'' class TestDog < Test::Unit::TestCase def test_dog_wags_tail_when_happy tail = flexmock("tail") tail.should_receive(:wag).once dog = Dog.new(tail) dog.happy end end FlexMock will automatically verify that the mocked tail object received the message +wag+ exactly one...