Skip to content

Commit

Permalink
Do not use Class#name in #marshal_dump
Browse files Browse the repository at this point in the history
  • Loading branch information
herwinw committed Sep 29, 2024
1 parent 9496445 commit 71c8361
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions spec/core/marshal/dump_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@
end

it "does not use Class#name" do
NATFIXME 'does not use Class#name', exception: SpecFailedException do
UserMarshal.should_not_receive(:name)
Marshal.dump(UserMarshal.new)
end
UserMarshal.should_not_receive(:name)
Marshal.dump(UserMarshal.new)
end

it "raises TypeError if an Object is an instance of an anonymous class" do
Expand Down
2 changes: 1 addition & 1 deletion src/marshal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def write_regexp(value)

def write_user_marshaled_object(value)
write_char('U')
write(value.class.name.to_sym)
write(value.class.to_s.to_sym)
write(value.send(:marshal_dump))
end

Expand Down

0 comments on commit 71c8361

Please sign in to comment.