Martin Hansen wrote:
> Ideas most welcome!

class Foo
  def bar
    system("wibble")
  end
end

require 'test/unit'
require 'mocha'
class TestFoo < Test::Unit::TestCase
  def test_foo
    a = Foo.new
    Foo.any_instance.expects(:system).with("wibble").returns("bibble")
    assert_equal "bibble", a.bar
  end
end

-- 
Posted via http://www.ruby-forum.com/.