class EventWithNamespaceTest

Public Instance Methods

setup() click to toggle source
# File test/unit/event_test.rb, line 312
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass, :namespace => 'alarm')
  @machine.events << @event = StateMachine::Event.new(@machine, :enable)
  @object = @klass.new
end
test_should_have_a_name() click to toggle source
# File test/unit/event_test.rb, line 319
def test_should_have_a_name
  assert_equal :enable, @event.name
end
test_should_have_a_qualified_name() click to toggle source
# File test/unit/event_test.rb, line 323
def test_should_have_a_qualified_name
  assert_equal :enable_alarm, @event.qualified_name
end
test_should_namespace_action() click to toggle source
# File test/unit/event_test.rb, line 335
def test_should_namespace_action
  assert @object.respond_to?(:enable_alarm)
end
test_should_namespace_bang_action() click to toggle source
# File test/unit/event_test.rb, line 339
def test_should_namespace_bang_action
  assert @object.respond_to?(:enable_alarm!)
end
test_should_namespace_predicate() click to toggle source
# File test/unit/event_test.rb, line 327
def test_should_namespace_predicate
  assert @object.respond_to?(:can_enable_alarm?)
end
test_should_namespace_transition_accessor() click to toggle source
# File test/unit/event_test.rb, line 331
def test_should_namespace_transition_accessor
  assert @object.respond_to?(:enable_alarm_transition)
end