state_machines-rspec 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.tool-versions +2 -0
- data/.travis.yml +15 -0
- data/README.md +1 -0
- data/lib/matchers/transitions/transition_from.rb +2 -1
- data/lib/state_machines_rspec/state_machines_introspector.rb +4 -0
- data/lib/state_machines_rspec/version.rb +1 -1
- data/spec/integration/integration_spec.rb +1 -0
- data/spec/integration/models/vehicle.rb +2 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 98d4e336e6771bbaa4ea39e7c4919512dd8829a3bb29948edf281b3330c1f937
|
4
|
+
data.tar.gz: cbf1fa5b36598b94db42e2e5c4d3ff0626e889780b5735e4f8827c6628adf189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec3075ce6ace2e3ee349516d5576f7b2962e0828c72cb0c9ddbdebbe19fe560b20564dfcd8918582ea5104e579a92da49ddda4ecf6b7429998c9f3a3fb1bf559
|
7
|
+
data.tar.gz: 508420369eaae022e22a8966bfa7303f9ca2d8f9fd628182ed624daec089777eddd4f4a50b77ec91bddce1b0ef0ae632a7fdf9be53da7c946c448a4d56443205
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.3
|
data/.tool-versions
ADDED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -44,6 +44,7 @@ describe Vehicle do
|
|
44
44
|
to_state: :parked, on_event: :park }
|
45
45
|
it { is_expected.to transition_from :active, to_state: :off,
|
46
46
|
on_event: :disable_alarm, on: :alarm_state }
|
47
|
+
it { is_expected.to transition_from :_any_, to_state: :stoped, on_event: :stop }
|
47
48
|
end
|
48
49
|
```
|
49
50
|
|
@@ -21,6 +21,7 @@ module StateMachinesRspec
|
|
21
21
|
def matches?(subject)
|
22
22
|
@subject = subject
|
23
23
|
@introspector = StateMachinesIntrospector.new(@subject, state_machine_scope)
|
24
|
+
@from_states = @introspector.all_states if from_states == [:_any_]
|
24
25
|
from_states.each do |from_state|
|
25
26
|
@from_state = from_state
|
26
27
|
enter_from_state
|
@@ -32,7 +33,7 @@ module StateMachinesRspec
|
|
32
33
|
|
33
34
|
def description
|
34
35
|
message = "transition state to :#{options[:to_state]} from "
|
35
|
-
message << from_states.map{ |state| ":#{state}" }.join(', ')
|
36
|
+
message << from_states.map { |state| ":#{state}" }.join(', ')
|
36
37
|
message << " on event :#{options[:on_event]}"
|
37
38
|
message << " on #{state_machine_scope.inspect}" if state_machine_scope
|
38
39
|
message
|
@@ -84,6 +84,7 @@ describe Vehicle do
|
|
84
84
|
|
85
85
|
it { is_expected.to transition_from :idling, :first_gear, to_state: :parked, on_event: :park }
|
86
86
|
it { is_expected.to transition_from :idling, to_state: :parked, on_event: :park }
|
87
|
+
it { is_expected.to transition_from :_any_, to_state: :stopped, on_event: :stop }
|
87
88
|
|
88
89
|
it 'has an initial state of "parked"' do
|
89
90
|
expect(vehicle).to be_parked
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_machines-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JohnSmall
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -177,6 +177,8 @@ files:
|
|
177
177
|
- ".gitignore"
|
178
178
|
- ".rspec"
|
179
179
|
- ".ruby-version"
|
180
|
+
- ".tool-versions"
|
181
|
+
- ".travis.yml"
|
180
182
|
- CHANGELOG.md
|
181
183
|
- Gemfile
|
182
184
|
- Guardfile
|
@@ -223,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
225
|
version: '0'
|
224
226
|
requirements: []
|
225
227
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.6
|
228
|
+
rubygems_version: 2.7.6
|
227
229
|
signing_key:
|
228
230
|
specification_version: 4
|
229
231
|
summary: RSpec matchers for state-machines/state_machines.
|