sequent 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sequent/test/command_handler_helpers.rb +1 -20
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cfc6364eb9b237df9e8869ef5d602e7e2509954
|
4
|
+
data.tar.gz: 4a280a35f92badb08aa8dbe2919d6aa329c6a23b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b56f436d037c8a9ba3718c512d413a2fe7e03822618c1a48c386cf45167490ee987223d596c432ce8bdfb367a76f044317ffb5081e5c4ec6056af065e4e1a09
|
7
|
+
data.tar.gz: 9bd699e91835b989e6f417bd9976826576742ef98e5c84e815ae9f68f6a9447993f28ed622426599b9fb242a5321e46f18ae4f1066d1454f1eb2e1463f01a9f7
|
@@ -33,11 +33,6 @@ module Sequent
|
|
33
33
|
# then_events InvoicePaidEvent(args)
|
34
34
|
# end
|
35
35
|
#
|
36
|
-
# it "rejects coupon when does not exist" do
|
37
|
-
# given_events CartCreatedEvent.new(args)
|
38
|
-
# when_command ApplyDiscountCouponCommand(args)
|
39
|
-
# then_fails_with CouponDoesNotExist
|
40
|
-
# end
|
41
36
|
# end
|
42
37
|
module CommandHandlerHelpers
|
43
38
|
|
@@ -125,20 +120,11 @@ module Sequent
|
|
125
120
|
def when_command command
|
126
121
|
raise "@command_handler is mandatory when using the #{self.class}" unless @command_handler
|
127
122
|
raise "Command handler #{@command_handler} cannot handle command #{command}, please configure the command type (forgot an include in the command class?)" unless @command_handler.handles_message?(command)
|
128
|
-
|
129
|
-
@command_handler.handle_message(command)
|
130
|
-
rescue => e
|
131
|
-
@unhandled_error = e
|
132
|
-
end
|
123
|
+
@command_handler.handle_message(command)
|
133
124
|
@repository.commit(command)
|
134
125
|
@repository.clear
|
135
126
|
end
|
136
127
|
|
137
|
-
def then_fails_with clazz
|
138
|
-
expect(@unhandled_error).to be_kind_of(clazz)
|
139
|
-
@unhandled_error = nil
|
140
|
-
end
|
141
|
-
|
142
128
|
def then_events *events
|
143
129
|
expect(@event_store.stored_events.map(&:class)).to eq(events.flatten(1).map(&:class))
|
144
130
|
@event_store.stored_events.zip(events.flatten(1)).each do |actual, expected|
|
@@ -150,11 +136,6 @@ module Sequent
|
|
150
136
|
then_events
|
151
137
|
end
|
152
138
|
|
153
|
-
def self.included(spec)
|
154
|
-
spec.after do
|
155
|
-
raise @unhandled_error if @unhandled_error
|
156
|
-
end
|
157
|
-
end
|
158
139
|
end
|
159
140
|
end
|
160
141
|
end
|
data/lib/version.rb
CHANGED