class DataMapperTest::MachineWithConflictingStateNameTest

Public Instance Methods

setup() click to toggle source
# File test/unit/integrations/data_mapper_test.rb, line 329
def setup
  require 'stringio'
  @original_stderr, $stderr = $stderr, StringIO.new
  
  @resource = new_resource
end
teardown() click to toggle source
Calls superclass method DataMapperTest::BaseTestCase#teardown
# File test/unit/integrations/data_mapper_test.rb, line 350
def teardown
  $stderr = @original_stderr
  super
end
test_should_not_output_warning_with_same_machine_name() click to toggle source
# File test/unit/integrations/data_mapper_test.rb, line 343
def test_should_not_output_warning_with_same_machine_name
  @machine = StateMachine::Machine.new(@resource, :public_state, :attribute => :state)
  @machine.state :state
  
  assert_equal '', $stderr.string
end
test_should_output_warning_with_same_machine_name() click to toggle source
# File test/unit/integrations/data_mapper_test.rb, line 336
def test_should_output_warning_with_same_machine_name
  @machine = StateMachine::Machine.new(@resource)
  @machine.state :state
  
  assert_match /^Instance method "state\?" is already defined in DataMapperTest::Foo :state instance helpers, use generic helper instead.*\n$/, $stderr.string
end