class MachineWithPrivateActionTest

Public Instance Methods

save() click to toggle source
# File test/unit/machine_test.rb, line 785
def save
end
setup() click to toggle source
# File test/unit/machine_test.rb, line 782
def setup
  @superclass = Class.new do
    private
    def save
    end
  end
  @klass = Class.new(@superclass)
  
  @machine = StateMachine::Machine.new(@klass, :action => :save)
  @object = @klass.new
end
test_should_define_action() click to toggle source
# File test/unit/machine_test.rb, line 810
def test_should_define_action
  assert @klass.ancestors.any? {|ancestor| ![@klass, @superclass].include?(ancestor) && ancestor.private_method_defined?(:save)}
end
test_should_define_an_event_attribute_reader() click to toggle source
# File test/unit/machine_test.rb, line 794
def test_should_define_an_event_attribute_reader
  assert @object.respond_to?(:state_event)
end
test_should_define_an_event_attribute_writer() click to toggle source
# File test/unit/machine_test.rb, line 798
def test_should_define_an_event_attribute_writer
  assert @object.respond_to?(:state_event=)
end
test_should_define_an_event_transition_attribute_reader() click to toggle source
# File test/unit/machine_test.rb, line 802
def test_should_define_an_event_transition_attribute_reader
  assert @object.respond_to?(:state_event_transition)
end
test_should_define_an_event_transition_attribute_writer() click to toggle source
# File test/unit/machine_test.rb, line 806
def test_should_define_an_event_transition_attribute_writer
  assert @object.respond_to?(:state_event_transition=)
end
test_should_keep_action_private() click to toggle source
# File test/unit/machine_test.rb, line 814
def test_should_keep_action_private
  assert @klass.private_method_defined?(:save)
end
test_should_mark_action_hook_as_defined() click to toggle source
# File test/unit/machine_test.rb, line 818
def test_should_mark_action_hook_as_defined
  assert @machine.action_hook?
end