Skip to content

Commit 987f8be

Browse files
authored
Merge pull request #259 from ridiculous/ridiculous-patch-1
Fix bug with marshalling experiments
2 parents fcb5050 + 2c4c6e9 commit 987f8be

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/scientist/experiment.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def marshal_dump
345345
[@name, @result, @raise_on_mismatches]
346346
end
347347

348-
def marshal_load
348+
def marshal_load(array)
349349
@name, @result, @raise_on_mismatches = array
350350
end
351351
end

test/scientist/experiment_test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ def @ex.raised(op, exception)
512512
assert_kind_of(String, Marshal.dump(mismatch))
513513
end
514514

515+
it "can be marshal loaded" do
516+
assert_kind_of(Fake, Marshal.load(Marshal.dump(@ex)))
517+
end
518+
515519
describe "#raise_on_mismatches?" do
516520
it "raises when there is a mismatch if the experiment instance's raise on mismatches is enabled" do
517521
Fake.raise_on_mismatches = false

0 commit comments

Comments
 (0)