slagyr / statemachine

Ruby Library for statemachines
http://slagyr.github.com/statemachine
Other
41 stars 9 forks source link

to_dot output does not show "default" transitions #7

Open chuckremes opened 13 years ago

chuckremes commented 13 years ago

Bug: Events are not drawn between states when they are defined as the "default" transition.

Version: 1.20

Repro:


require 'rubygems'
require 'statemachine'
require 'statemachine/generate/util'
require 'statemachine/generate/src_builder'
require 'statemachine/generate/dot_graph/dot_graph_statemachine'

#

class Machine
  def self.build
    Statemachine.build do
      state :one do
        event :foo, :two
      end

      state :two do
        default :two
      end
    end # Statemachine.build
  end
end # class Machine

m = Machine.build
m.to_dot(:output => 'foo')

The graphviz output should show some kind of "transition to self" event for the :two state.