module Kernel
Public Instance Methods
mock(method, options = {}, &block)
click to toggle source
Create a pure mock object rather than mocking specific methods on an object.
Examples¶ ↑
my_mock = mock(:thing, :return => "whee!") my_mock.thing # => "whee"
# File lib/motion-spec/mock/mock.rb, line 57 def mock(method, options = {}, &block) mock_object = Object.new mock_object.mock!(method, options, &block) mock_object end
print(*args)
click to toggle source
# File lib/motion-spec.rb, line 60 def print(*args) puts *args # TODO end
puts(*args)
click to toggle source
# File lib/motion-spec.rb, line 56 def puts(*args) NSLog(args.join("\n")) end
stub(method, options = {}, &block)
click to toggle source
Private Instance Methods
describe(*args, &block)
click to toggle source
# File lib/motion-spec/extensions/kernel.rb, line 4 def describe(*args, &block) MotionSpec::Context.new(args.join(' '), &block) end
Also aliased as: context