class CallbackWithUnlessConditionTest

Public Instance Methods

setup() click to toggle source
# File test/unit/callback_test.rb, line 297
def setup
  @object = Object.new
end
test_should_call_if_false() click to toggle source
# File test/unit/callback_test.rb, line 301
def test_should_call_if_false
  callback = StateMachine::Callback.new(:before, :unless => lambda {false}, :do => lambda {})
  assert callback.call(@object)
end
test_should_not_call_if_true() click to toggle source
# File test/unit/callback_test.rb, line 306
def test_should_not_call_if_true
  callback = StateMachine::Callback.new(:before, :unless => lambda {true}, :do => lambda {})
  assert !callback.call(@object)
end