pluginaweek/state_machine — Issue #136: Behaviors not working when defined with (any - :a_state)
Author: cosenmarco
Created: 2011-10-28 16:15:08+00:00
State: open

Declaring a behaviour like this:

```ruby
state (any - :a_state) do
do_something
end
```

doesn't work.
After some debugging it seems that the StateCollection is filled with BlacklistMatchers and this is not handled correctly.

A simple test:

```ruby
require 'rubygems'
require 'state_machine'

class SM
state_machine :initial => :a do

event :goto_b do
transition :a => :b
end

event :goto_c do
transition :b => :c
end

state (any - [:a, :c]) do
def test_method
'b'
end
end

state :a, :c do
def test_method
'a or c'
end
end

end
end

sm = SM.new

p sm.test_method # => "a or c"

sm.goto_b

p sm.test_method # NoMethod error
```