end_state 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/end_state/transition.rb +1 -1
- data/lib/end_state/version.rb +1 -1
- data/spec/end_state/transition_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cea33d2599a01b2e2a1849e18ce89606dd884577
|
4
|
+
data.tar.gz: 8cf3d052502eaae9b7ea7b3fc932dca9c2f97f30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74d3571600173f5fb01c25436f6802efb685fb0c77a48632d6c33e7720aa16a568f90aa420d0aa524e5d78d3c996e2d50d4f47556d24ef9699d94a4cbfa08740
|
7
|
+
data.tar.gz: f561fe882b2e239062f195414303262df153e1c79bbd257eb2f7ee2483130e63e261022dc92867076caa71011c360c57a10fad1db0aec496900a81baf75b865e
|
data/lib/end_state/transition.rb
CHANGED
@@ -55,8 +55,8 @@ module EndState
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def rollback(concluded, params)
|
58
|
-
concluded.reverse_each { |concluder| concluder.new(object, state, params).rollback }
|
59
58
|
action.new(object, previous_state).rollback
|
59
|
+
concluded.reverse_each { |concluder| concluder.new(object, state, params).rollback }
|
60
60
|
false
|
61
61
|
end
|
62
62
|
|
data/lib/end_state/version.rb
CHANGED
@@ -146,10 +146,10 @@ module EndState
|
|
146
146
|
let(:mode) { :soft }
|
147
147
|
|
148
148
|
it 'returns false and rolls back the completed concluders and the action' do
|
149
|
+
expect(action_instance).to receive(:rollback).ordered
|
149
150
|
expect(concluder3_instance).to_not receive(:rollback)
|
150
151
|
expect(concluder2_instance).to receive(:rollback).ordered
|
151
152
|
expect(concluder1_instance).to receive(:rollback).ordered
|
152
|
-
expect(action_instance).to receive(:rollback).ordered
|
153
153
|
|
154
154
|
expect(transition.call).to be false
|
155
155
|
end
|
@@ -159,10 +159,10 @@ module EndState
|
|
159
159
|
let(:mode) { :hard }
|
160
160
|
|
161
161
|
it 'raises ConcluderFailed and rolls back the completed concluders and the action' do
|
162
|
+
expect(action_instance).to receive(:rollback).ordered
|
162
163
|
expect(concluder3_instance).to_not receive(:rollback)
|
163
164
|
expect(concluder2_instance).to receive(:rollback).ordered
|
164
165
|
expect(concluder1_instance).to receive(:rollback).ordered
|
165
|
-
expect(action_instance).to receive(:rollback).ordered
|
166
166
|
|
167
167
|
expect{transition.call}.to raise_error(ConcluderFailed, 'The transition to b was rolled back: service failure')
|
168
168
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: end_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alexpeachey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.
|
152
|
+
rubygems_version: 2.5.1
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: A State Machine implementation
|