Skip to content

Commit

Permalink
Remove redundant if/else in matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ColumODonovann committed Nov 10, 2023
1 parent b75eec7 commit 96b66dd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions spec/mars_rovers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,7 @@

RSpec::Matchers.define :be_located_at do |expected_point|
match do |actual_point|
if actual_point.is_a?(MarsRover)
actual_point.point == expected_point
else
actual_point == expected_point
end
actual_point.point == expected_point
end
failure_message do |actual_point|
"expected that #{actual_point} would have the same coordinates as #{expected_point}. Coordinates:\n
Expand Down

0 comments on commit 96b66dd

Please sign in to comment.