mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-03 09:45:14 +08:00
27 lines
461 B
Ruby
27 lines
461 B
Ruby
class Object
|
|
def stub!(sym)
|
|
Mock.install_method self, sym, :stub
|
|
end
|
|
|
|
def should_receive(sym)
|
|
Mock.install_method self, sym
|
|
end
|
|
|
|
def should_not_receive(sym)
|
|
proxy = Mock.install_method self, sym
|
|
proxy.exactly(0).times
|
|
end
|
|
|
|
def mock(name, options={})
|
|
MockObject.new name, options
|
|
end
|
|
|
|
def mock_int(val)
|
|
MockIntObject.new(val)
|
|
end
|
|
|
|
def mock_numeric(name, options={})
|
|
NumericMockObject.new name, options
|
|
end
|
|
end
|