Fix flipped expected and actual labels

NilMatcher output was correct, but variables were named incorrectly.
This commit is contained in:
Michael Miller 2019-02-28 16:08:22 -07:00
parent 1219b19d89
commit d5bef6f1da
2 changed files with 5 additions and 5 deletions

View file

@ -34,13 +34,13 @@ module Spectator::Matchers
# Describes the condition that satisfies the matcher.
# This is informational and displayed to the end-user.
def message
"#{@values.expected_label} is #{@values.actual_label} (using ==)"
"#{@values.actual_label} is #{@values.expected_label} (using ==)"
end
# Describes the condition that won't satsify the matcher.
# This is informational and displayed to the end-user.
def negated_message
"#{@values.expected_label} is not #{@values.actual_label} (using ==)"
"#{@values.actual_label} is not #{@values.expected_label} (using ==)"
end
end
end

View file

@ -20,7 +20,7 @@ module Spectator::Matchers
# Match data specific to this matcher.
private struct MatchData(T) < MatchData
# Creates the match data.
def initialize(matched, @actual : T, @expected_label : String)
def initialize(matched, @actual : T, @actual_label : String)
super(matched)
end
@ -35,13 +35,13 @@ module Spectator::Matchers
# Describes the condition that satisfies the matcher.
# This is informational and displayed to the end-user.
def message
"#{@expected_label} is nil"
"#{@actual_label} is nil"
end
# Describes the condition that won't satsify the matcher.
# This is informational and displayed to the end-user.
def negated_message
"#{@expected_label} is not nil"
"#{@actual_label} is not nil"
end
end
end