class CallbackByDefaultTest

Public Instance Methods

setup() click to toggle source
# File test/unit/callback_test.rb, line 56
def setup
  @callback = StateMachine::Callback.new(:before) {}
end
test_should_have_a_branch_with_all_matcher_requirements() click to toggle source
# File test/unit/callback_test.rb, line 68
def test_should_have_a_branch_with_all_matcher_requirements
  assert_equal StateMachine::AllMatcher.instance, @callback.branch.event_requirement
  assert_equal StateMachine::AllMatcher.instance, @callback.branch.state_requirements.first[:from]
  assert_equal StateMachine::AllMatcher.instance, @callback.branch.state_requirements.first[:to]
end
test_should_have_type() click to toggle source
# File test/unit/callback_test.rb, line 60
def test_should_have_type
  assert_equal :before, @callback.type
end
test_should_not_have_a_terminator() click to toggle source
# File test/unit/callback_test.rb, line 64
def test_should_not_have_a_terminator
  assert_nil @callback.terminator
end
test_should_not_have_any_known_states() click to toggle source
# File test/unit/callback_test.rb, line 74
def test_should_not_have_any_known_states
  assert_equal [], @callback.known_states
end