class CallbackWithUnboundMethodTest

Public Instance Methods

setup() click to toggle source
# File test/unit/callback_test.rb, line 371
def setup
  @callback = StateMachine::Callback.new(:before, :do => lambda {|*args| @context = args.unshift(self)})
  
  @object = Object.new
  @callback.call(@object, {}, 1, 2, 3)
end
test_should_call_method_outside_the_context_of_the_object() click to toggle source
# File test/unit/callback_test.rb, line 378
def test_should_call_method_outside_the_context_of_the_object
  assert_equal [self, @object, 1, 2, 3], @context
end