Skip to content

Commit

Permalink
Change variable name in matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ColumODonovann committed Nov 10, 2023
1 parent 96b66dd commit cb20923
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/mars_rovers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@
end

RSpec::Matchers.define :be_located_at do |expected_point|
match do |actual_point|
actual_point.point == expected_point
match do |mars_rover|
mars_rover.point == expected_point
end
failure_message do |actual_point|
"expected that #{actual_point} would have the same coordinates as #{expected_point}. Coordinates:\n
failure_message do |mars_rover|
"expected that #{mars_rover} would have the same coordinates as #{expected_point}. Coordinates:\n
ACTUAL | EXPECTED\n
X: #{actual_point.x} | #{expected_point.x}\n
Y: #{actual_point.y} | #{expected_point.y}\n
D: #{actual_point.direction} | #{expected_point.direction}\n"
X: #{mars_rover.point.x} | #{expected_point.x}\n
Y: #{mars_rover.point.y} | #{expected_point.y}\n
D: #{mars_rover.point.direction} | #{expected_point.direction}\n"
end
end
end

0 comments on commit cb20923

Please sign in to comment.