Skip to content

Commit b7ab3cb

Browse files
committed
Remove splat operator support from in_streams
1 parent 4a05038 commit b7ab3cb

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

ruby_event_store-rspec/lib/ruby_event_store/rspec/have_published.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def in_stream(stream_name)
3030
self
3131
end
3232

33-
def in_streams(*stream_names)
34-
@stream_names = stream_names.flatten
33+
def in_streams(stream_names)
34+
@stream_names = Array(stream_names)
3535
self
3636
end
3737

ruby_event_store-rspec/spec/ruby_event_store/rspec/have_published_spec.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,7 @@ def phraser
127127
event_store.publish(event = FooEvent.new, stream_name: "Foo")
128128
event_store.link(event.event_id, stream_name: "Bar")
129129

130-
expect(event_store).to matcher(matchers.an_event(FooEvent)).in_streams("Foo", "Bar")
131-
end
132-
133-
specify do
134-
event_store.publish(event = FooEvent.new, stream_name: "Foo")
135-
event_store.link(event.event_id, stream_name: "Bar")
136-
137-
expect(event_store).to matcher(matchers.an_event(FooEvent)).in_streams("Foo", "Bar")
130+
expect(event_store).to matcher(matchers.an_event(FooEvent)).in_streams(["Foo", "Bar"])
138131
end
139132

140133
specify do
@@ -147,7 +140,7 @@ def phraser
147140
specify do
148141
event_store.publish(FooEvent.new, stream_name: "Foo")
149142

150-
expect(event_store).not_to matcher(matchers.an_event(FooEvent)).in_streams("Foo", "Bar")
143+
expect(event_store).not_to matcher(matchers.an_event(FooEvent)).in_streams(["Foo", "Bar"])
151144
end
152145

153146
specify do

ruby_event_store-rspec/spec/ruby_event_store/rspec/step_by_step_failure_message_formatter_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def failure_message_formatter
343343

344344
specify do
345345
event_store.publish(FooEvent.new, stream_name: "Foo")
346-
matcher_ = matcher(matchers.an_event(FooEvent)).in_streams("Foo", "Bar")
346+
matcher_ = matcher(matchers.an_event(FooEvent)).in_streams(["Foo", "Bar"])
347347
matcher_.matches?(event_store)
348348

349349
expect(matcher_.failure_message.to_s).to eq(<<~EOS)
@@ -359,7 +359,7 @@ def failure_message_formatter
359359

360360
specify do
361361
event_store.publish(FooEvent.new, stream_name: "Bar")
362-
matcher_ = matcher(matchers.an_event(FooEvent)).in_streams("Foo", "Bar")
362+
matcher_ = matcher(matchers.an_event(FooEvent)).in_streams(["Foo", "Bar"])
363363
matcher_.matches?(event_store)
364364

365365
expect(matcher_.failure_message.to_s).to eq(<<~EOS)

0 commit comments

Comments
 (0)