Skip to content

Commit 1bcbab1

Browse files
committed
Fix failing tests
1 parent 2a80f9c commit 1bcbab1

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

test/scientist/experiment_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def @ex.publish(result)
181181
end
182182

183183
it "compares errors with an error comparator block if provided" do
184-
@ex.error_compare { |a, b| a.class == b.class }
184+
@ex.compare_errors { |a, b| a.class == b.class }
185185
@ex.use { raise "foo" }
186186
@ex.try { raise "bar" }
187187

test/scientist/observation_test.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,19 @@
9797
b = Scientist::Observation.new("test", @experiment) { "1" }
9898

9999
refute a.equivalent_to?(b)
100-
assert a.equivalent_to?(b) { |x, y| x.to_s == y.to_s }
100+
101+
compare_on_string = -> (x, y) { x.to_s == y.to_s }
102+
103+
assert a.equivalent_to?(b, compare_on_string)
101104

102105
yielded = []
103-
a.equivalent_to?(b) do |x, y|
106+
compare_appends = -> (x, y) do
104107
yielded << x
105108
yielded << y
106109
true
107110
end
111+
a.equivalent_to?(b, compare_appends)
112+
108113
assert_equal [a.value, b.value], yielded
109114
end
110115

0 commit comments

Comments
 (0)