class MachineWithCustomNameTest

Public Instance Methods

setup() click to toggle source
# File test/unit/machine_test.rb, line 183
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass, :status)
  @object = @klass.new
end
test_should_define_a_human_attribute_name_reader_for_the_attribute() click to toggle source
# File test/unit/machine_test.rb, line 225
def test_should_define_a_human_attribute_name_reader_for_the_attribute
  assert @klass.respond_to?(:human_status_name)
end
test_should_define_a_human_event_name_reader_for_the_attribute() click to toggle source
# File test/unit/machine_test.rb, line 229
def test_should_define_a_human_event_name_reader_for_the_attribute
  assert @klass.respond_to?(:human_status_event_name)
end
test_should_define_a_name_reader_for_the_attribute() click to toggle source
# File test/unit/machine_test.rb, line 213
def test_should_define_a_name_reader_for_the_attribute
  assert @object.respond_to?(:status_name)
end
test_should_define_a_predicate_for_the_attribute() click to toggle source
# File test/unit/machine_test.rb, line 209
def test_should_define_a_predicate_for_the_attribute
  assert @object.respond_to?(:status?)
end
test_should_define_a_reader_attribute_for_the_attribute() click to toggle source
# File test/unit/machine_test.rb, line 201
def test_should_define_a_reader_attribute_for_the_attribute
  assert @object.respond_to?(:status)
end
test_should_define_a_transition_reader_for_the_attribute() click to toggle source
# File test/unit/machine_test.rb, line 221
def test_should_define_a_transition_reader_for_the_attribute
  assert @object.respond_to?(:status_transitions)
end
test_should_define_a_writer_attribute_for_the_attribute() click to toggle source
# File test/unit/machine_test.rb, line 205
def test_should_define_a_writer_attribute_for_the_attribute
  assert @object.respond_to?(:status=)
end
test_should_define_an_event_reader_for_the_attribute() click to toggle source
# File test/unit/machine_test.rb, line 217
def test_should_define_an_event_reader_for_the_attribute
  assert @object.respond_to?(:status_events)
end
test_should_prefix_custom_attributes_with_custom_name() click to toggle source
# File test/unit/machine_test.rb, line 197
def test_should_prefix_custom_attributes_with_custom_name
  assert_equal :status_event, @machine.attribute(:event)
end
test_should_use_custom_name() click to toggle source
# File test/unit/machine_test.rb, line 189
def test_should_use_custom_name
  assert_equal :status, @machine.name
end
test_should_use_custom_name_for_attribute() click to toggle source
# File test/unit/machine_test.rb, line 193
def test_should_use_custom_name_for_attribute
  assert_equal :status, @machine.attribute
end