ruby_event_store-rspec 2.11.1 → 2.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 638fa1b511d0b28ae3d470dd541c5ad458094c30e228f7ccd9c4b07ff24deb34
4
- data.tar.gz: e46881c118a8b12c56e7c9330af7be6f791a1ee4fab787c5f8888b89f49968e7
3
+ metadata.gz: 9db5361e0890074eb6926b9d9174b41b7446e2e9904d09d286117600f1fa4ecf
4
+ data.tar.gz: 51b37d9506603fff2a4840b590bbe08c7ff62358a5c8183ab11a89281d427ec4
5
5
  SHA512:
6
- metadata.gz: a0513e1c988889f15e1e158ca3a277341dfcf3c04f403065a3d19d4dad39286bd3f5ae9a75c10c34f0b091a67a4671a830791e679ed228edd1f9c1ade7245796
7
- data.tar.gz: 9578ca3dc081d16939cf10fb1b8d30a03c2558d0d5924825593ea1724fa30cd343934a8789a5d6bad44ec69c2f551aabf60ee952d5f0d257c44ba3d9f7a9207c
6
+ metadata.gz: 6dbbf798201a07ab74a43715a5ecc547c62452a71205dff43b3f42d4865f0179706f9d240ac048624d437deffa93a30947a5138865ce3c232f0a9bb38b39ab7b
7
+ data.tar.gz: da2acd85438be4f50e530fe0597e02684d3fdccb51dc2975c129aa45c387588df73ad13351228f2a9c9516903d975330764da6ef96e259837d94cad819240134
@@ -15,10 +15,6 @@ module RubyEventStore
15
15
  @event_store = event_store
16
16
  end
17
17
 
18
- def from_last
19
- @start = call.last&.event_id
20
- end
21
-
22
18
  def call
23
19
  raise MissingEventStore if event_store.nil?
24
20
  events = event_store.read
@@ -7,6 +7,7 @@ module RubyEventStore
7
7
  @expected = ExpectedCollection.new(expected)
8
8
  @failure_message_formatter = failure_message_formatter
9
9
  @fetch_events = FetchEvents.new
10
+ @start_for_stream = {}
10
11
  end
11
12
 
12
13
  def in(event_store)
@@ -45,10 +46,16 @@ module RubyEventStore
45
46
  end
46
47
 
47
48
  def matches?(event_proc)
48
- fetch_events.from_last
49
+ stream_names.each do |stream_name|
50
+ fetch_events.stream(stream_name)
51
+ @start_for_stream[stream_name] = fetch_events.call.last&.event_id
52
+ end
53
+
49
54
  event_proc.call
55
+
50
56
  stream_names.all? do |stream_name|
51
57
  fetch_events.stream(stream_name)
58
+ fetch_events.from(@start_for_stream.fetch(stream_name))
52
59
  @published_events = fetch_events.call.to_a
53
60
  @failed_on_stream = stream_name
54
61
  MatchEvents.new.call(expected, published_events)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RubyEventStore
4
4
  module RSpec
5
- VERSION = "2.11.1"
5
+ VERSION = "2.12.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_event_store-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.1
4
+ version: 2.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-24 00:00:00.000000000 Z
11
+ date: 2023-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec