Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
bdvineti committed Mar 2, 2021
1 parent 9c50f32 commit d71f716
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/flatware/rspec/checkpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(events = {})

EVENTS.each do |event|
define_method(event) do |notification|
events[event] = Marshalable.for_event(event).from_notification(notification)
events[event] = Marshalable.for_event(event).from_rspec(notification)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/flatware/rspec/marshalable/examples_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def +(other)

attr_reader :reporter

def self.from_notification(rspec_notification)
def self.from_rspec(rspec_notification)
new Reporter.from_rspec(rspec_notification.instance_variable_get(:@reporter))
end

Expand Down
2 changes: 1 addition & 1 deletion lib/flatware/rspec/marshalable/profile_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def +(other)
)
end

def self.from_notification(rspec_notification)
def self.from_rspec(rspec_notification)
new(
rspec_notification.duration,
rspec_notification.examples.map(&Example.method(:new)),
Expand Down
2 changes: 1 addition & 1 deletion lib/flatware/rspec/marshalable/summary_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def failures?
[failure_count, errors_outside_of_examples_count].any?(&:positive?)
end

def self.from_notification(summary)
def self.from_rspec(summary)
serialized_examples = [
summary.examples,
summary.failed_examples,
Expand Down
4 changes: 2 additions & 2 deletions spec/flatware/rspec/checkpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
)

bad_news = described_class.new(
dump_summary: Flatware::RSpec::Marshalable::SummaryNotification.from_notification(
dump_summary: Flatware::RSpec::Marshalable::SummaryNotification.from_rspec(
::RSpec::Core::Notifications::SummaryNotification.new(0, [], [failure_notification], [], 0, 0)
)
)

good_news = described_class.new(
dump_summary: Flatware::RSpec::Marshalable::SummaryNotification.from_notification(
dump_summary: Flatware::RSpec::Marshalable::SummaryNotification.from_rspec(
::RSpec::Core::Notifications::SummaryNotification.new(0, [], [], [], 0, 0)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)

notifications = [[], [failed_example]].map do |failed_examples|
described_class.from_notification(
described_class.from_rspec(
instance_double(
::RSpec::Core::Notifications::ExamplesNotification,
instance_variable_get: instance_double(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def args

it 'plays nice with the rspec formatting stuff' do
notification = ::RSpec::Core::Notifications::SummaryNotification.new(*args)
summary = described_class.from_notification(notification)
summary = described_class.from_rspec(notification)
expect(summary.fully_formatted).to match(/Finished/)
end
end

0 comments on commit d71f716

Please sign in to comment.