Skip to content

Commit

Permalink
Rename to match passed arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlyobvious committed Jan 30, 2023
1 parent 0b04b81 commit 0611e35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def initialize(repository, instrumentation)
end

def append_to_stream(records, stream, expected_version)
instrumentation.instrument("append_to_stream.repository.ruby_event_store", events: records, stream: stream) do
instrumentation.instrument("append_to_stream.repository.ruby_event_store", records: records, stream: stream) do
repository.append_to_stream(records, stream, expected_version)
end
end
Expand Down Expand Up @@ -37,9 +37,9 @@ def count(specification)
end
end

def update_messages(messages)
instrumentation.instrument("update_messages.repository.ruby_event_store", messages: messages) do
repository.update_messages(messages)
def update_messages(records)
instrumentation.instrument("update_messages.repository.ruby_event_store", records: records) do
repository.update_messages(records)
end
end

Expand Down
8 changes: 6 additions & 2 deletions ruby_event_store/spec/instrumented_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ module RubyEventStore
subscribe_to("append_to_stream.repository.ruby_event_store") do |notification_calls|
instrumented_repository.append_to_stream([record], stream, expected_version)

expect(notification_calls).to eq([{ events: [record], stream: stream }])
expect(notification_calls).to eq([
{ records: [record], stream: stream }
])
end
end
end
Expand Down Expand Up @@ -143,7 +145,9 @@ module RubyEventStore
subscribe_to("update_messages.repository.ruby_event_store") do |notification_calls|
instrumented_repository.update_messages([record])

expect(notification_calls).to eq([{ messages: [record] }])
expect(notification_calls).to eq([
{ records: [record] }
])
end
end
end
Expand Down

0 comments on commit 0611e35

Please sign in to comment.