Skip to content

Commit

Permalink
Merge pull request #259 from ridiculous/ridiculous-patch-1
Browse files Browse the repository at this point in the history
Fix bug with marshalling experiments
  • Loading branch information
zerowidth authored Jun 17, 2024
2 parents fcb5050 + 2c4c6e9 commit 987f8be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scientist/experiment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def marshal_dump
[@name, @result, @raise_on_mismatches]
end

def marshal_load
def marshal_load(array)
@name, @result, @raise_on_mismatches = array
end
end
4 changes: 4 additions & 0 deletions test/scientist/experiment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ def @ex.raised(op, exception)
assert_kind_of(String, Marshal.dump(mismatch))
end

it "can be marshal loaded" do
assert_kind_of(Fake, Marshal.load(Marshal.dump(@ex)))
end

describe "#raise_on_mismatches?" do
it "raises when there is a mismatch if the experiment instance's raise on mismatches is enabled" do
Fake.raise_on_mismatches = false
Expand Down

0 comments on commit 987f8be

Please sign in to comment.