class StateDrawingLambdaValueTest

Public Instance Methods

setup() click to toggle source
# File test/unit/state_test.rb, line 892
def setup
  @machine = StateMachine::Machine.new(Class.new)
  @machine.states << @state = StateMachine::State.new(@machine, :parked, :value => lambda {})
  
  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 904
def test_should_use_description_as_label
  assert_equal 'parked (*)', @node['label'].to_s.gsub('"', '')
end
test_should_use_stringified_name_as_name() click to toggle source
# File test/unit/state_test.rb, line 900
def test_should_use_stringified_name_as_name
  assert_equal 'parked', Gem::Version.new(Constants::RGV_VERSION) <= Gem::Version.new('0.9.11') ? @node.name : @node.id
end