class StateDrawingTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/state_test.rb, line 819 def setup @machine = StateMachine::Machine.new(Class.new) @machine.states << @state = StateMachine::State.new(@machine, :parked, :value => 1) @machine.event :ignite do transition :parked => :idling end graph = GraphViz.new('G') @node = @state.draw(graph) end
test_should_set_height_to_one()
click to toggle source
# File test/unit/state_test.rb, line 838 def test_should_set_height_to_one assert_equal '1', @node['height'].to_s.gsub('"', '') end
test_should_set_width_to_one()
click to toggle source
# File test/unit/state_test.rb, line 834 def test_should_set_width_to_one assert_equal '1', @node['width'].to_s.gsub('"', '') end
test_should_use_description_as_label()
click to toggle source
# File test/unit/state_test.rb, line 846 def test_should_use_description_as_label assert_equal 'parked (1)', @node['label'].to_s.gsub('"', '') end
test_should_use_ellipse_shape()
click to toggle source
# File test/unit/state_test.rb, line 830 def test_should_use_ellipse_shape assert_equal 'ellipse', @node['shape'].to_s.gsub('"', '') end
test_should_use_stringified_name_as_name()
click to toggle source
# File test/unit/state_test.rb, line 842 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