class FlexMock

+

+

FlexMock is a flexible mock object framework for creating and using test doubles (mocks, stubs and spies).

Basic Usage:

m = flexmock("name")
m.should_receive(:upcase).with("stuff").
  and_return("STUFF")
m.should_receive(:downcase).with(String).
  and_return { |s| s.downcase }.once

With Test::Unit Integration:

class TestSomething < Test::Unit::TestCase
  def test_something
    m = flexmock("name")
    m.should_receive(:hi).and_return("Hello")
    m.hi
  end
end

Note: Also, if you override teardown, make sure you call super.

Deprecated Methods

The following methods are no longer supported in FlexMock. Include this file for legacy applications.

Permission is granted for use, copying, modification, distribution,
and distribution of modified versions of this work as long as the
above copyright notice is included.

+++

Permission is granted for use, copying, modification, distribution,
and distribution of modified versions of this work as long as the
above copyright notice is included.

+++

Permission is granted for use, copying, modification, distribution,
and distribution of modified versions of this work as long as the
above copyright notice is included.

+++

Permission is granted for use, copying, modification, distribution,
and distribution of modified versions of this work as long as the
above copyright notice is included.

+++