class EventWithConflictingHelpersAfterDefinitionTest

Public Instance Methods

can_ignite?() click to toggle source
# File test/unit/event_test.rb, line 193
def can_ignite?
  0
end
ignite() click to toggle source
# File test/unit/event_test.rb, line 201
def ignite
  0
end
ignite!() click to toggle source
# File test/unit/event_test.rb, line 205
def ignite!
  0
end
ignite_transition() click to toggle source
# File test/unit/event_test.rb, line 197
def ignite_transition
  0
end
setup() click to toggle source
# File test/unit/event_test.rb, line 188
def setup
  require 'stringio'
  @original_stderr, $stderr = $stderr, StringIO.new
  
  @klass = Class.new do
    def can_ignite?
      0
    end
    
    def ignite_transition
      0
    end
    
    def ignite
      0
    end
    
    def ignite!
      0
    end
  end
  @machine = StateMachine::Machine.new(@klass)
  @machine.events << @event = StateMachine::Event.new(@machine, :ignite)
  @object = @klass.new
end
teardown() click to toggle source
# File test/unit/event_test.rb, line 259
def teardown
  $stderr = @original_stderr
end
test_should_allow_super_chaining() click to toggle source
# File test/unit/event_test.rb, line 230
def test_should_allow_super_chaining
  @klass.class_eval do
    def can_ignite?
      super
    end
    
    def ignite_transition
      super
    end
    
    def ignite
      super
    end
    
    def ignite!
      super
    end
  end
  
  assert_equal false, @object.can_ignite?
  assert_equal nil, @object.ignite_transition
  assert_equal false, @object.ignite
  assert_raise(StateMachine::InvalidTransition) { @object.ignite! }
end
test_should_not_output_warning() click to toggle source
# File test/unit/event_test.rb, line 255
def test_should_not_output_warning
  assert_equal '', $stderr.string
end
test_should_not_redefine_action() click to toggle source
# File test/unit/event_test.rb, line 222
def test_should_not_redefine_action
  assert_equal 0, @object.ignite
end
test_should_not_redefine_bang_action() click to toggle source
# File test/unit/event_test.rb, line 226
def test_should_not_redefine_bang_action
  assert_equal 0, @object.ignite!
end
test_should_not_redefine_predicate() click to toggle source
# File test/unit/event_test.rb, line 214
def test_should_not_redefine_predicate
  assert_equal 0, @object.can_ignite?
end
test_should_not_redefine_transition_accessor() click to toggle source
# File test/unit/event_test.rb, line 218
def test_should_not_redefine_transition_accessor
  assert_equal 0, @object.ignite_transition
end