class BranchDrawingWithExceptFromRequirementTest

Public Instance Methods

setup() click to toggle source
# File test/unit/branch_test.rb, line 812
def setup
  @machine = StateMachine::Machine.new(Class.new)
  states = [:parked, :idling, :first_gear]
  
  graph = GraphViz.new('G')
  states.each {|state| graph.add_node(state.to_s)}
  
  @branch = StateMachine::Branch.new(:except_from => :parked, :to => :parked)
  @edges = @branch.draw(graph, :park, states)
end
test_should_generate_edges_for_each_valid_from_state() click to toggle source
# File test/unit/branch_test.rb, line 823
def test_should_generate_edges_for_each_valid_from_state
  %w(idling first_gear).each_with_index do |from_state, index|
    edge = @edges[index]
    assert_equal from_state, edge.instance_variable_get('@xNodeOne')
    assert_equal 'parked', edge.instance_variable_get('@xNodeTwo')
  end
end