class StateDrawingNilNameTest

Public Instance Methods

setup() click to toggle source
# File test/unit/state_test.rb, line 874
def setup
  @machine = StateMachine::Machine.new(Class.new)
  @machine.states << @state = StateMachine::State.new(@machine, nil)
  
  graph = GraphViz.new('G')
  @node = @state.draw(graph)
end
test_should_use_description_as_label() click to toggle source
# File test/unit/state_test.rb, line 886
def test_should_use_description_as_label
  assert_equal 'nil', @node['label'].to_s.gsub('"', '')
end
test_should_use_stringified_nil_as_name() click to toggle source
# File test/unit/state_test.rb, line 882
def test_should_use_stringified_nil_as_name
  assert_equal 'nil', Gem::Version.new(Constants::RGV_VERSION) <= Gem::Version.new('0.9.11') ? @node.name : @node.id
end