class MachineWithNamespaceTest

Public Instance Methods

setup() click to toggle source
# File test/unit/machine_test.rb, line 2855
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass, :namespace => 'alarm', :initial => :active) do
    event :enable do
      transition :off => :active
    end
    
    event :disable do
      transition :active => :off
    end
  end
  @object = @klass.new
end
test_should_namespace_bang_events() click to toggle source
# File test/unit/machine_test.rb, line 2893
def test_should_namespace_bang_events
  [:enable_alarm!, :disable_alarm!].each do |name|
    assert @object.respond_to?(name)
  end
end
test_should_namespace_event_checks() click to toggle source
# File test/unit/machine_test.rb, line 2875
def test_should_namespace_event_checks
  [:can_enable_alarm?, :can_disable_alarm?].each do |name|
    assert @object.respond_to?(name)
  end
end
test_should_namespace_event_transition_readers() click to toggle source
# File test/unit/machine_test.rb, line 2881
def test_should_namespace_event_transition_readers
  [:enable_alarm_transition, :disable_alarm_transition].each do |name|
    assert @object.respond_to?(name)
  end
end
test_should_namespace_events() click to toggle source
# File test/unit/machine_test.rb, line 2887
def test_should_namespace_events
  [:enable_alarm, :disable_alarm].each do |name|
    assert @object.respond_to?(name)
  end
end
test_should_namespace_state_predicates() click to toggle source
# File test/unit/machine_test.rb, line 2869
def test_should_namespace_state_predicates
  [:alarm_active?, :alarm_off?].each do |name|
    assert @object.respond_to?(name)
  end
end