state_machine 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1276,9 +1276,9 @@ class MachineWithTransitionCallbacksTest < Test::Unit::TestCase
1276
1276
  assert_nothing_raised {@machine.before_transition :invalid => true, :do => lambda {}}
1277
1277
  end
1278
1278
 
1279
- def test_should_raise_exception_if_do_option_not_specified
1279
+ def test_should_raise_exception_if_method_not_specified
1280
1280
  exception = assert_raise(ArgumentError) {@machine.before_transition :to => :idling}
1281
- assert_equal ':do callback must be specified', exception.message
1281
+ assert_equal 'Method(s) for callback must be specified', exception.message
1282
1282
  end
1283
1283
 
1284
1284
  def test_should_invoke_callbacks_during_transition
@@ -79,27 +79,6 @@ class TransitionTest < Test::Unit::TestCase
79
79
  end
80
80
  end
81
81
 
82
- class TransitionWithoutEventTest < Test::Unit::TestCase
83
- def setup
84
- @klass = Class.new
85
- @machine = StateMachine::Machine.new(@klass)
86
- @machine.state :parked, :idling
87
-
88
- @object = @klass.new
89
- @object.state = 'parked'
90
-
91
- @transition = StateMachine::Transition.new(@object, @machine, nil, :parked, :idling)
92
- end
93
-
94
- def test_should_not_have_an_event
95
- assert_nil @transition.event
96
- end
97
-
98
- def test_should_not_have_a_qualified_event
99
- assert_nil @transition.qualified_event
100
- end
101
- end
102
-
103
82
  class TransitionWithInvalidNodesTest < Test::Unit::TestCase
104
83
  def setup
105
84
  @klass = Class.new
@@ -111,6 +90,10 @@ class TransitionWithInvalidNodesTest < Test::Unit::TestCase
111
90
  @object.state = 'parked'
112
91
  end
113
92
 
93
+ def test_should_raise_exception_without_event
94
+ assert_raise(IndexError) { StateMachine::Transition.new(@object, @machine, nil, :parked, :idling) }
95
+ end
96
+
114
97
  def test_should_raise_exception_with_invalid_event
115
98
  assert_raise(IndexError) { StateMachine::Transition.new(@object, @machine, :invalid, :parked, :idling) }
116
99
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Pfeifer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-05 00:00:00 -04:00
12
+ date: 2009-04-08 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15