Skip to content

Commit 7368e94

Browse files
mostlyobviousfidel
authored andcommitted
Rename to match instrumented methods and their arguments
1 parent ae1154d commit 7368e94

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: rails_event_store/spec/client_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module RailsEventStore
4949
specify "wraps mapper into instrumentation" do
5050
client = Client.new(repository: RubyEventStore::InMemoryRepository.new, mapper: RubyEventStore::Mappers::Default.new)
5151
received_notifications = 0
52-
ActiveSupport::Notifications.subscribe("serialize.mapper.ruby_event_store") { received_notifications += 1 }
52+
ActiveSupport::Notifications.subscribe("event_to_record.mapper.ruby_event_store") { received_notifications += 1 }
5353

5454
client.publish(TestEvent.new)
5555

Diff for: ruby_event_store/lib/ruby_event_store/mappers/instrumented_mapper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ def initialize(mapper, instrumentation)
99
end
1010

1111
def event_to_record(event)
12-
instrumentation.instrument("serialize.mapper.ruby_event_store", domain_event: event) do
12+
instrumentation.instrument("event_to_record.mapper.ruby_event_store", event: event) do
1313
mapper.event_to_record(event)
1414
end
1515
end
1616

1717
def record_to_event(record)
18-
instrumentation.instrument("deserialize.mapper.ruby_event_store", record: record) do
18+
instrumentation.instrument("record_to_event.mapper.ruby_event_store", record: record) do
1919
mapper.record_to_event(record)
2020
end
2121
end

Diff for: ruby_event_store/spec/mappers/instrumented_mapper_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ module Mappers
2020

2121
specify "instruments" do
2222
instrumented_mapper = InstrumentedMapper.new(spy, ActiveSupport::Notifications)
23-
subscribe_to("serialize.mapper.ruby_event_store") do |notification_calls|
23+
subscribe_to("event_to_record.mapper.ruby_event_store") do |notification_calls|
2424
instrumented_mapper.event_to_record(event)
25-
expect(notification_calls).to eq([{ domain_event: event }])
25+
expect(notification_calls).to eq([{ event: event }])
2626
end
2727
end
2828
end
@@ -38,7 +38,7 @@ module Mappers
3838

3939
specify "instruments" do
4040
instrumented_mapper = InstrumentedMapper.new(spy, ActiveSupport::Notifications)
41-
subscribe_to("deserialize.mapper.ruby_event_store") do |notification_calls|
41+
subscribe_to("record_to_event.mapper.ruby_event_store") do |notification_calls|
4242
instrumented_mapper.record_to_event(record)
4343
expect(notification_calls).to eq([{ record: record }])
4444
end

0 commit comments

Comments
 (0)