Skip to content

Commit

Permalink
Add spec for passing nil proc to Marshal.load
Browse files Browse the repository at this point in the history
  • Loading branch information
headius authored and eregon committed Mar 27, 2017
1 parent 9bffb07 commit 23946be
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/marshal/shared/load.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@
end
end

describe "when called with nil for the proc argument" do
it "behaves as if no proc argument was passed" do
a = [1]
a << a
lambda do
b = Marshal.send(@method, Marshal.dump(a), nil)
b.should == a
end.should_not raise_error
end
end

describe "when called on objects with custom _dump methods" do
it "does not set instance variables of an object with user-defined _dump/_load" do
# this string represents: <#UserPreviouslyDefinedWithInitializedIvar @field2=7 @field1=6>
Expand Down

0 comments on commit 23946be

Please sign in to comment.