Skip to content

Commit 2a80f9c

Browse files
committed
Rename error_compare to compare_errors
1 parent 1f9a487 commit 2a80f9c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/scientist/experiment.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def compare(*args, &block)
127127
# and return true or false.
128128
#
129129
# Returns the block.
130-
def error_compare(*args, &block)
130+
def compare_errors(*args, &block)
131131
@_scientist_error_comparator = block
132132
end
133133

@@ -174,7 +174,7 @@ def name
174174
"experiment"
175175
end
176176

177-
# Internal: compare two observations, using the configured compare and error_compare lambdas if present.
177+
# Internal: compare two observations, using the configured compare and compare_errors lambdas if present.
178178
def observations_are_equivalent?(a, b)
179179
a.equivalent_to? b, @_scientist_comparator, @_scientist_error_comparator
180180
rescue StandardError => ex

lib/scientist/observation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def equivalent_to?(other, comparator=nil, error_comparator=nil)
7070

7171
if raised? || other.raised?
7272
if error_comparator
73-
error_comparator.call(exception, other.exception)
73+
return error_comparator.call(exception, other.exception)
7474
else
7575
return other.exception.class == exception.class &&
7676
other.exception.message == exception.message

0 commit comments

Comments
 (0)