enum_state_machine 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/enum_state_machine.gemspec +2 -2
- data/lib/enum_state_machine/event.rb +1 -1
- data/lib/enum_state_machine/machine.rb +2 -2
- data/lib/enum_state_machine/state.rb +1 -1
- data/lib/enum_state_machine/version.rb +1 -1
- data/test/functional/state_machine_test.rb +20 -20
- data/test/test_helper.rb +15 -1
- data/test/unit/assertions_test.rb +1 -1
- data/test/unit/branch_test.rb +42 -42
- data/test/unit/callback_test.rb +27 -27
- data/test/unit/error_test.rb +2 -2
- data/test/unit/eval_helpers_test.rb +1 -1
- data/test/unit/event_collection_test.rb +10 -10
- data/test/unit/event_test.rb +38 -38
- data/test/unit/graph_test.rb +4 -4
- data/test/unit/helper_module_test.rb +1 -1
- data/test/unit/integrations/active_model_test.rb +1 -1
- data/test/unit/integrations/active_record_test.rb +15 -15
- data/test/unit/integrations/base_test.rb +2 -2
- data/test/unit/integrations_test.rb +2 -2
- data/test/unit/invalid_event_test.rb +1 -1
- data/test/unit/invalid_parallel_transition_test.rb +1 -1
- data/test/unit/invalid_transition_test.rb +3 -3
- data/test/unit/machine_collection_test.rb +15 -15
- data/test/unit/machine_test.rb +114 -114
- data/test/unit/matcher_helpers_test.rb +3 -3
- data/test/unit/matcher_test.rb +7 -7
- data/test/unit/node_collection_test.rb +13 -13
- data/test/unit/path_collection_test.rb +8 -8
- data/test/unit/path_test.rb +13 -13
- data/test/unit/state_collection_test.rb +10 -10
- data/test/unit/state_context_test.rb +10 -10
- data/test/unit/state_enum_test.rb +1 -1
- data/test/unit/state_machine_test.rb +2 -2
- data/test/unit/state_test.rb +52 -52
- data/test/unit/transition_collection_test.rb +41 -41
- data/test/unit/transition_test.rb +29 -29
- metadata +10 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
|
2
2
|
|
|
3
|
-
class MatcherHelpersAllTest <
|
|
3
|
+
class MatcherHelpersAllTest < Minitest::Test
|
|
4
4
|
include EnumStateMachine::MatcherHelpers
|
|
5
5
|
|
|
6
6
|
def setup
|
|
@@ -12,7 +12,7 @@ class MatcherHelpersAllTest < MiniTest::Test
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
class MatcherHelpersAnyTest <
|
|
15
|
+
class MatcherHelpersAnyTest < Minitest::Test
|
|
16
16
|
include EnumStateMachine::MatcherHelpers
|
|
17
17
|
|
|
18
18
|
def setup
|
|
@@ -24,7 +24,7 @@ class MatcherHelpersAnyTest < MiniTest::Test
|
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
class MatcherHelpersSameTest <
|
|
27
|
+
class MatcherHelpersSameTest < Minitest::Test
|
|
28
28
|
include EnumStateMachine::MatcherHelpers
|
|
29
29
|
|
|
30
30
|
def setup
|
data/test/unit/matcher_test.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
|
2
2
|
|
|
3
|
-
class MatcherByDefaultTest <
|
|
3
|
+
class MatcherByDefaultTest < Minitest::Test
|
|
4
4
|
def setup
|
|
5
5
|
@matcher = EnumStateMachine::Matcher.new
|
|
6
6
|
end
|
|
@@ -14,7 +14,7 @@ class MatcherByDefaultTest < MiniTest::Test
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
class MatcherWithValueTest <
|
|
17
|
+
class MatcherWithValueTest < Minitest::Test
|
|
18
18
|
def setup
|
|
19
19
|
@matcher = EnumStateMachine::Matcher.new(nil)
|
|
20
20
|
end
|
|
@@ -28,7 +28,7 @@ class MatcherWithValueTest < MiniTest::Test
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
class MatcherWithMultipleValuesTest <
|
|
31
|
+
class MatcherWithMultipleValuesTest < Minitest::Test
|
|
32
32
|
def setup
|
|
33
33
|
@matcher = EnumStateMachine::Matcher.new([:parked, :idling])
|
|
34
34
|
end
|
|
@@ -42,7 +42,7 @@ class MatcherWithMultipleValuesTest < MiniTest::Test
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
class AllMatcherTest <
|
|
45
|
+
class AllMatcherTest < Minitest::Test
|
|
46
46
|
def setup
|
|
47
47
|
@matcher = EnumStateMachine::AllMatcher.instance
|
|
48
48
|
end
|
|
@@ -70,7 +70,7 @@ class AllMatcherTest < MiniTest::Test
|
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
class WhitelistMatcherTest <
|
|
73
|
+
class WhitelistMatcherTest < Minitest::Test
|
|
74
74
|
def setup
|
|
75
75
|
@matcher = EnumStateMachine::WhitelistMatcher.new([:parked, :idling])
|
|
76
76
|
end
|
|
@@ -99,7 +99,7 @@ class WhitelistMatcherTest < MiniTest::Test
|
|
|
99
99
|
end
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
class BlacklistMatcherTest <
|
|
102
|
+
class BlacklistMatcherTest < Minitest::Test
|
|
103
103
|
def setup
|
|
104
104
|
@matcher = EnumStateMachine::BlacklistMatcher.new([:parked, :idling])
|
|
105
105
|
end
|
|
@@ -128,7 +128,7 @@ class BlacklistMatcherTest < MiniTest::Test
|
|
|
128
128
|
end
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
-
class LoopbackMatcherTest <
|
|
131
|
+
class LoopbackMatcherTest < Minitest::Test
|
|
132
132
|
def setup
|
|
133
133
|
@matcher = EnumStateMachine::LoopbackMatcher.instance
|
|
134
134
|
end
|
|
@@ -6,7 +6,7 @@ class Node < Struct.new(:name, :value, :machine)
|
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
class NodeCollectionByDefaultTest <
|
|
9
|
+
class NodeCollectionByDefaultTest < Minitest::Test
|
|
10
10
|
def setup
|
|
11
11
|
@machine = EnumStateMachine::Machine.new(Class.new)
|
|
12
12
|
@collection = EnumStateMachine::NodeCollection.new(@machine)
|
|
@@ -26,7 +26,7 @@ class NodeCollectionByDefaultTest < MiniTest::Test
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
class NodeCollectionTest <
|
|
29
|
+
class NodeCollectionTest < Minitest::Test
|
|
30
30
|
def setup
|
|
31
31
|
@machine = EnumStateMachine::Machine.new(Class.new)
|
|
32
32
|
@collection = EnumStateMachine::NodeCollection.new(@machine)
|
|
@@ -50,7 +50,7 @@ class NodeCollectionTest < MiniTest::Test
|
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
class NodeCollectionAfterBeingCopiedTest <
|
|
53
|
+
class NodeCollectionAfterBeingCopiedTest < Minitest::Test
|
|
54
54
|
def setup
|
|
55
55
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
56
56
|
@collection = EnumStateMachine::NodeCollection.new(machine)
|
|
@@ -94,7 +94,7 @@ class NodeCollectionAfterBeingCopiedTest < MiniTest::Test
|
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
96
|
|
|
97
|
-
class NodeCollectionWithoutIndicesTest <
|
|
97
|
+
class NodeCollectionWithoutIndicesTest < Minitest::Test
|
|
98
98
|
def setup
|
|
99
99
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
100
100
|
@collection = EnumStateMachine::NodeCollection.new(machine, :index => {})
|
|
@@ -123,7 +123,7 @@ class NodeCollectionWithoutIndicesTest < MiniTest::Test
|
|
|
123
123
|
end
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
-
class NodeCollectionWithIndicesTest <
|
|
126
|
+
class NodeCollectionWithIndicesTest < Minitest::Test
|
|
127
127
|
def setup
|
|
128
128
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
129
129
|
@collection = EnumStateMachine::NodeCollection.new(machine, :index => [:name, :value])
|
|
@@ -163,7 +163,7 @@ class NodeCollectionWithIndicesTest < MiniTest::Test
|
|
|
163
163
|
end
|
|
164
164
|
end
|
|
165
165
|
|
|
166
|
-
class NodeCollectionWithNodesTest <
|
|
166
|
+
class NodeCollectionWithNodesTest < Minitest::Test
|
|
167
167
|
def setup
|
|
168
168
|
@machine = EnumStateMachine::Machine.new(Class.new)
|
|
169
169
|
@collection = EnumStateMachine::NodeCollection.new(@machine)
|
|
@@ -207,7 +207,7 @@ class NodeCollectionWithNodesTest < MiniTest::Test
|
|
|
207
207
|
end
|
|
208
208
|
end
|
|
209
209
|
|
|
210
|
-
class NodeCollectionAfterUpdateTest <
|
|
210
|
+
class NodeCollectionAfterUpdateTest < Minitest::Test
|
|
211
211
|
def setup
|
|
212
212
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
213
213
|
@collection = EnumStateMachine::NodeCollection.new(machine, :index => [:name, :value])
|
|
@@ -241,7 +241,7 @@ class NodeCollectionAfterUpdateTest < MiniTest::Test
|
|
|
241
241
|
end
|
|
242
242
|
end
|
|
243
243
|
|
|
244
|
-
class NodeCollectionWithStringIndexTest <
|
|
244
|
+
class NodeCollectionWithStringIndexTest < Minitest::Test
|
|
245
245
|
def setup
|
|
246
246
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
247
247
|
@collection = EnumStateMachine::NodeCollection.new(machine, :index => [:name, :value])
|
|
@@ -259,7 +259,7 @@ class NodeCollectionWithStringIndexTest < MiniTest::Test
|
|
|
259
259
|
end
|
|
260
260
|
end
|
|
261
261
|
|
|
262
|
-
class NodeCollectionWithSymbolIndexTest <
|
|
262
|
+
class NodeCollectionWithSymbolIndexTest < Minitest::Test
|
|
263
263
|
def setup
|
|
264
264
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
265
265
|
@collection = EnumStateMachine::NodeCollection.new(machine, :index => [:name, :value])
|
|
@@ -277,7 +277,7 @@ class NodeCollectionWithSymbolIndexTest < MiniTest::Test
|
|
|
277
277
|
end
|
|
278
278
|
end
|
|
279
279
|
|
|
280
|
-
class NodeCollectionWithNumericIndexTest <
|
|
280
|
+
class NodeCollectionWithNumericIndexTest < Minitest::Test
|
|
281
281
|
def setup
|
|
282
282
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
283
283
|
@collection = EnumStateMachine::NodeCollection.new(machine, :index => [:name, :value])
|
|
@@ -299,7 +299,7 @@ class NodeCollectionWithNumericIndexTest < MiniTest::Test
|
|
|
299
299
|
end
|
|
300
300
|
end
|
|
301
301
|
|
|
302
|
-
class NodeCollectionWithPredefinedContextsTest <
|
|
302
|
+
class NodeCollectionWithPredefinedContextsTest < Minitest::Test
|
|
303
303
|
def setup
|
|
304
304
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
305
305
|
@collection = EnumStateMachine::NodeCollection.new(machine)
|
|
@@ -320,7 +320,7 @@ class NodeCollectionWithPredefinedContextsTest < MiniTest::Test
|
|
|
320
320
|
end
|
|
321
321
|
end
|
|
322
322
|
|
|
323
|
-
class NodeCollectionWithPostdefinedContextsTest <
|
|
323
|
+
class NodeCollectionWithPostdefinedContextsTest < Minitest::Test
|
|
324
324
|
def setup
|
|
325
325
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
326
326
|
@collection = EnumStateMachine::NodeCollection.new(machine)
|
|
@@ -340,7 +340,7 @@ class NodeCollectionWithPostdefinedContextsTest < MiniTest::Test
|
|
|
340
340
|
end
|
|
341
341
|
end
|
|
342
342
|
|
|
343
|
-
class NodeCollectionWithMatcherContextsTest <
|
|
343
|
+
class NodeCollectionWithMatcherContextsTest < Minitest::Test
|
|
344
344
|
def setup
|
|
345
345
|
machine = EnumStateMachine::Machine.new(Class.new)
|
|
346
346
|
@collection = EnumStateMachine::NodeCollection.new(machine)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
|
2
2
|
|
|
3
|
-
class PathCollectionByDefaultTest <
|
|
3
|
+
class PathCollectionByDefaultTest < Minitest::Test
|
|
4
4
|
def setup
|
|
5
5
|
@klass = Class.new
|
|
6
6
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -45,7 +45,7 @@ class PathCollectionByDefaultTest < MiniTest::Test
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
class PathCollectionTest <
|
|
48
|
+
class PathCollectionTest < Minitest::Test
|
|
49
49
|
def setup
|
|
50
50
|
@klass = Class.new
|
|
51
51
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -74,7 +74,7 @@ class PathCollectionTest < MiniTest::Test
|
|
|
74
74
|
end
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
class PathCollectionWithPathsTest <
|
|
77
|
+
class PathCollectionWithPathsTest < Minitest::Test
|
|
78
78
|
def setup
|
|
79
79
|
@klass = Class.new
|
|
80
80
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -120,7 +120,7 @@ class PathCollectionWithPathsTest < MiniTest::Test
|
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
-
class PathWithGuardedPathsTest <
|
|
123
|
+
class PathWithGuardedPathsTest < Minitest::Test
|
|
124
124
|
def setup
|
|
125
125
|
@klass = Class.new
|
|
126
126
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -145,7 +145,7 @@ class PathWithGuardedPathsTest < MiniTest::Test
|
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
147
|
|
|
148
|
-
class PathCollectionWithDuplicateNodesTest <
|
|
148
|
+
class PathCollectionWithDuplicateNodesTest < Minitest::Test
|
|
149
149
|
def setup
|
|
150
150
|
@klass = Class.new
|
|
151
151
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -175,7 +175,7 @@ class PathCollectionWithDuplicateNodesTest < MiniTest::Test
|
|
|
175
175
|
end
|
|
176
176
|
end
|
|
177
177
|
|
|
178
|
-
class PathCollectionWithFromStateTest <
|
|
178
|
+
class PathCollectionWithFromStateTest < Minitest::Test
|
|
179
179
|
def setup
|
|
180
180
|
@klass = Class.new
|
|
181
181
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -201,7 +201,7 @@ class PathCollectionWithFromStateTest < MiniTest::Test
|
|
|
201
201
|
end
|
|
202
202
|
end
|
|
203
203
|
|
|
204
|
-
class PathCollectionWithToStateTest <
|
|
204
|
+
class PathCollectionWithToStateTest < Minitest::Test
|
|
205
205
|
def setup
|
|
206
206
|
@klass = Class.new
|
|
207
207
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -229,7 +229,7 @@ class PathCollectionWithToStateTest < MiniTest::Test
|
|
|
229
229
|
end
|
|
230
230
|
end
|
|
231
231
|
|
|
232
|
-
class PathCollectionWithDeepPathsTest <
|
|
232
|
+
class PathCollectionWithDeepPathsTest < Minitest::Test
|
|
233
233
|
def setup
|
|
234
234
|
@klass = Class.new
|
|
235
235
|
@machine = EnumStateMachine::Machine.new(@klass)
|
data/test/unit/path_test.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
|
2
2
|
|
|
3
|
-
class PathByDefaultTest <
|
|
3
|
+
class PathByDefaultTest < Minitest::Test
|
|
4
4
|
def setup
|
|
5
5
|
@klass = Class.new
|
|
6
6
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -52,7 +52,7 @@ class PathByDefaultTest < MiniTest::Test
|
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
class PathTest <
|
|
55
|
+
class PathTest < Minitest::Test
|
|
56
56
|
def setup
|
|
57
57
|
@klass = Class.new
|
|
58
58
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -67,7 +67,7 @@ class PathTest < MiniTest::Test
|
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
-
class PathWithoutTransitionsTest <
|
|
70
|
+
class PathWithoutTransitionsTest < Minitest::Test
|
|
71
71
|
def setup
|
|
72
72
|
@klass = Class.new
|
|
73
73
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -89,7 +89,7 @@ class PathWithoutTransitionsTest < MiniTest::Test
|
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
-
class PathWithTransitionsTest <
|
|
92
|
+
class PathWithTransitionsTest < Minitest::Test
|
|
93
93
|
def setup
|
|
94
94
|
@klass = Class.new
|
|
95
95
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -141,7 +141,7 @@ class PathWithTransitionsTest < MiniTest::Test
|
|
|
141
141
|
end
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
-
class PathWithDuplicatesTest <
|
|
144
|
+
class PathWithDuplicatesTest < Minitest::Test
|
|
145
145
|
def setup
|
|
146
146
|
@klass = Class.new
|
|
147
147
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -172,7 +172,7 @@ class PathWithDuplicatesTest < MiniTest::Test
|
|
|
172
172
|
end
|
|
173
173
|
end
|
|
174
174
|
|
|
175
|
-
class PathWithAvailableTransitionsTest <
|
|
175
|
+
class PathWithAvailableTransitionsTest < Minitest::Test
|
|
176
176
|
def setup
|
|
177
177
|
@klass = Class.new
|
|
178
178
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -225,7 +225,7 @@ class PathWithAvailableTransitionsTest < MiniTest::Test
|
|
|
225
225
|
end
|
|
226
226
|
end
|
|
227
227
|
|
|
228
|
-
class PathWithGuardedTransitionsTest <
|
|
228
|
+
class PathWithGuardedTransitionsTest < Minitest::Test
|
|
229
229
|
def setup
|
|
230
230
|
@klass = Class.new
|
|
231
231
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -266,7 +266,7 @@ class PathWithGuardedTransitionsTest < MiniTest::Test
|
|
|
266
266
|
end
|
|
267
267
|
end
|
|
268
268
|
|
|
269
|
-
class PathWithEncounteredTransitionsTest <
|
|
269
|
+
class PathWithEncounteredTransitionsTest < Minitest::Test
|
|
270
270
|
def setup
|
|
271
271
|
@klass = Class.new
|
|
272
272
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -299,7 +299,7 @@ class PathWithEncounteredTransitionsTest < MiniTest::Test
|
|
|
299
299
|
end
|
|
300
300
|
end
|
|
301
301
|
|
|
302
|
-
class PathWithUnreachedTargetTest <
|
|
302
|
+
class PathWithUnreachedTargetTest < Minitest::Test
|
|
303
303
|
def setup
|
|
304
304
|
@klass = Class.new
|
|
305
305
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -328,7 +328,7 @@ class PathWithUnreachedTargetTest < MiniTest::Test
|
|
|
328
328
|
end
|
|
329
329
|
end
|
|
330
330
|
|
|
331
|
-
class PathWithReachedTargetTest <
|
|
331
|
+
class PathWithReachedTargetTest < Minitest::Test
|
|
332
332
|
def setup
|
|
333
333
|
@klass = Class.new
|
|
334
334
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -361,7 +361,7 @@ class PathWithReachedTargetTest < MiniTest::Test
|
|
|
361
361
|
end
|
|
362
362
|
end
|
|
363
363
|
|
|
364
|
-
class PathWithAvailableTransitionsAfterReachingTargetTest <
|
|
364
|
+
class PathWithAvailableTransitionsAfterReachingTargetTest < Minitest::Test
|
|
365
365
|
def setup
|
|
366
366
|
@klass = Class.new
|
|
367
367
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -399,7 +399,7 @@ class PathWithAvailableTransitionsAfterReachingTargetTest < MiniTest::Test
|
|
|
399
399
|
end
|
|
400
400
|
end
|
|
401
401
|
|
|
402
|
-
class PathWithDeepTargetTest <
|
|
402
|
+
class PathWithDeepTargetTest < Minitest::Test
|
|
403
403
|
def setup
|
|
404
404
|
@klass = Class.new
|
|
405
405
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -438,7 +438,7 @@ class PathWithDeepTargetTest < MiniTest::Test
|
|
|
438
438
|
end
|
|
439
439
|
end
|
|
440
440
|
|
|
441
|
-
class PathWithDeepTargetReachedTest <
|
|
441
|
+
class PathWithDeepTargetReachedTest < Minitest::Test
|
|
442
442
|
def setup
|
|
443
443
|
@klass = Class.new
|
|
444
444
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
|
2
2
|
|
|
3
|
-
class StateCollectionByDefaultTest <
|
|
3
|
+
class StateCollectionByDefaultTest < Minitest::Test
|
|
4
4
|
def setup
|
|
5
5
|
@machine = EnumStateMachine::Machine.new(Class.new)
|
|
6
6
|
@states = EnumStateMachine::StateCollection.new(@machine)
|
|
@@ -19,7 +19,7 @@ class StateCollectionByDefaultTest < MiniTest::Test
|
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
class StateCollectionTest <
|
|
22
|
+
class StateCollectionTest < Minitest::Test
|
|
23
23
|
def setup
|
|
24
24
|
@klass = Class.new
|
|
25
25
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -92,7 +92,7 @@ class StateCollectionTest < MiniTest::Test
|
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
-
class StateCollectionStringTest <
|
|
95
|
+
class StateCollectionStringTest < Minitest::Test
|
|
96
96
|
def setup
|
|
97
97
|
@klass = Class.new
|
|
98
98
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -126,7 +126,7 @@ class StateCollectionStringTest < MiniTest::Test
|
|
|
126
126
|
end
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
-
class StateCollectionWithNamespaceTest <
|
|
129
|
+
class StateCollectionWithNamespaceTest < Minitest::Test
|
|
130
130
|
def setup
|
|
131
131
|
@klass = Class.new
|
|
132
132
|
@machine = EnumStateMachine::Machine.new(@klass, :namespace => 'vehicle')
|
|
@@ -145,7 +145,7 @@ class StateCollectionWithNamespaceTest < MiniTest::Test
|
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
147
|
|
|
148
|
-
class StateCollectionWithCustomStateValuesTest <
|
|
148
|
+
class StateCollectionWithCustomStateValuesTest < Minitest::Test
|
|
149
149
|
def setup
|
|
150
150
|
@klass = Class.new
|
|
151
151
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -172,7 +172,7 @@ class StateCollectionWithCustomStateValuesTest < MiniTest::Test
|
|
|
172
172
|
end
|
|
173
173
|
end
|
|
174
174
|
|
|
175
|
-
class StateCollectionWithStateMatchersTest <
|
|
175
|
+
class StateCollectionWithStateMatchersTest < Minitest::Test
|
|
176
176
|
def setup
|
|
177
177
|
@klass = Class.new
|
|
178
178
|
@machine = EnumStateMachine::Machine.new(@klass)
|
|
@@ -199,7 +199,7 @@ class StateCollectionWithStateMatchersTest < MiniTest::Test
|
|
|
199
199
|
end
|
|
200
200
|
end
|
|
201
201
|
|
|
202
|
-
class StateCollectionWithInitialStateTest <
|
|
202
|
+
class StateCollectionWithInitialStateTest < Minitest::Test
|
|
203
203
|
def setup
|
|
204
204
|
@machine = EnumStateMachine::Machine.new(Class.new)
|
|
205
205
|
@states = EnumStateMachine::StateCollection.new(@machine)
|
|
@@ -237,7 +237,7 @@ class StateCollectionWithInitialStateTest < MiniTest::Test
|
|
|
237
237
|
end
|
|
238
238
|
end
|
|
239
239
|
|
|
240
|
-
class StateCollectionWithStateBehaviorsTest <
|
|
240
|
+
class StateCollectionWithStateBehaviorsTest < Minitest::Test
|
|
241
241
|
def setup
|
|
242
242
|
@machine = EnumStateMachine::Machine.new(Class.new)
|
|
243
243
|
@states = EnumStateMachine::StateCollection.new(@machine)
|
|
@@ -275,7 +275,7 @@ class StateCollectionWithStateBehaviorsTest < MiniTest::Test
|
|
|
275
275
|
end
|
|
276
276
|
end
|
|
277
277
|
|
|
278
|
-
class StateCollectionWithEventTransitionsTest <
|
|
278
|
+
class StateCollectionWithEventTransitionsTest < Minitest::Test
|
|
279
279
|
def setup
|
|
280
280
|
@machine = EnumStateMachine::Machine.new(Class.new)
|
|
281
281
|
@states = EnumStateMachine::StateCollection.new(@machine)
|
|
@@ -313,7 +313,7 @@ class StateCollectionWithEventTransitionsTest < MiniTest::Test
|
|
|
313
313
|
end
|
|
314
314
|
end
|
|
315
315
|
|
|
316
|
-
class StateCollectionWithTransitionCallbacksTest <
|
|
316
|
+
class StateCollectionWithTransitionCallbacksTest < Minitest::Test
|
|
317
317
|
def setup
|
|
318
318
|
@machine = EnumStateMachine::Machine.new(Class.new)
|
|
319
319
|
@states = EnumStateMachine::StateCollection.new(@machine)
|
|
@@ -9,7 +9,7 @@ class Validateable
|
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
class StateContextTest <
|
|
12
|
+
class StateContextTest < Minitest::Test
|
|
13
13
|
def setup
|
|
14
14
|
@klass = Class.new(Validateable)
|
|
15
15
|
@machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -27,7 +27,7 @@ class StateContextTest < MiniTest::Test
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
class StateContextTransitionTest <
|
|
30
|
+
class StateContextTransitionTest < Minitest::Test
|
|
31
31
|
def setup
|
|
32
32
|
@klass = Class.new
|
|
33
33
|
@machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -132,7 +132,7 @@ class StateContextTransitionTest < MiniTest::Test
|
|
|
132
132
|
end
|
|
133
133
|
end
|
|
134
134
|
|
|
135
|
-
class StateContextWithMatchingTransitionTest <
|
|
135
|
+
class StateContextWithMatchingTransitionTest < Minitest::Test
|
|
136
136
|
def setup
|
|
137
137
|
@klass = Class.new
|
|
138
138
|
@machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -158,7 +158,7 @@ class StateContextWithMatchingTransitionTest < MiniTest::Test
|
|
|
158
158
|
end
|
|
159
159
|
end
|
|
160
160
|
|
|
161
|
-
class StateContextProxyTest <
|
|
161
|
+
class StateContextProxyTest < Minitest::Test
|
|
162
162
|
def setup
|
|
163
163
|
@klass = Class.new(Validateable)
|
|
164
164
|
machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -183,7 +183,7 @@ class StateContextProxyTest < MiniTest::Test
|
|
|
183
183
|
end
|
|
184
184
|
end
|
|
185
185
|
|
|
186
|
-
class StateContextProxyWithoutConditionsTest <
|
|
186
|
+
class StateContextProxyWithoutConditionsTest < Minitest::Test
|
|
187
187
|
def setup
|
|
188
188
|
@klass = Class.new(Validateable)
|
|
189
189
|
machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -213,7 +213,7 @@ class StateContextProxyWithoutConditionsTest < MiniTest::Test
|
|
|
213
213
|
end
|
|
214
214
|
end
|
|
215
215
|
|
|
216
|
-
class StateContextProxyWithIfConditionTest <
|
|
216
|
+
class StateContextProxyWithIfConditionTest < Minitest::Test
|
|
217
217
|
def setup
|
|
218
218
|
@klass = Class.new(Validateable)
|
|
219
219
|
machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -276,7 +276,7 @@ class StateContextProxyWithIfConditionTest < MiniTest::Test
|
|
|
276
276
|
end
|
|
277
277
|
end
|
|
278
278
|
|
|
279
|
-
class StateContextProxyWithMultipleIfConditionsTest <
|
|
279
|
+
class StateContextProxyWithMultipleIfConditionsTest < Minitest::Test
|
|
280
280
|
def setup
|
|
281
281
|
@klass = Class.new(Validateable)
|
|
282
282
|
machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -307,7 +307,7 @@ class StateContextProxyWithMultipleIfConditionsTest < MiniTest::Test
|
|
|
307
307
|
end
|
|
308
308
|
end
|
|
309
309
|
|
|
310
|
-
class StateContextProxyWithUnlessConditionTest <
|
|
310
|
+
class StateContextProxyWithUnlessConditionTest < Minitest::Test
|
|
311
311
|
def setup
|
|
312
312
|
@klass = Class.new(Validateable)
|
|
313
313
|
machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -370,7 +370,7 @@ class StateContextProxyWithUnlessConditionTest < MiniTest::Test
|
|
|
370
370
|
end
|
|
371
371
|
end
|
|
372
372
|
|
|
373
|
-
class StateContextProxyWithMultipleUnlessConditionsTest <
|
|
373
|
+
class StateContextProxyWithMultipleUnlessConditionsTest < Minitest::Test
|
|
374
374
|
def setup
|
|
375
375
|
@klass = Class.new(Validateable)
|
|
376
376
|
machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -401,7 +401,7 @@ class StateContextProxyWithMultipleUnlessConditionsTest < MiniTest::Test
|
|
|
401
401
|
end
|
|
402
402
|
end
|
|
403
403
|
|
|
404
|
-
class StateContextProxyWithIfAndUnlessConditionsTest <
|
|
404
|
+
class StateContextProxyWithIfAndUnlessConditionsTest < Minitest::Test
|
|
405
405
|
def setup
|
|
406
406
|
@klass = Class.new(Validateable)
|
|
407
407
|
machine = EnumStateMachine::Machine.new(@klass, :initial => :parked)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
|
2
2
|
|
|
3
|
-
class EnumStateMachineByDefaultTest <
|
|
3
|
+
class EnumStateMachineByDefaultTest < Minitest::Test
|
|
4
4
|
def setup
|
|
5
5
|
@klass = Class.new
|
|
6
6
|
@machine = @klass.state_machine
|
|
@@ -11,7 +11,7 @@ class EnumStateMachineByDefaultTest < MiniTest::Test
|
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
class EnumStateMachineTest <
|
|
14
|
+
class EnumStateMachineTest < Minitest::Test
|
|
15
15
|
def setup
|
|
16
16
|
@klass = Class.new
|
|
17
17
|
end
|