Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
diff --git a/spec/ruby/1.8/library/singleton/load_spec.rb b/spec/ruby/1.8/library/singleton/load_spec.rb index 486d3a6..18d303d 100644 --- a/spec/ruby/1.8/library/singleton/load_spec.rb +++ b/spec/ruby/1.8/library/singleton/load_spec.rb @@ -26,4 +26,14 @@ describe "Singleton._load" do klone.send(:_load, 42).equal?(klone.instance).should == true end -end \ No newline at end of file +end + +describe "Marshal.load on serialized singleton objects" do + ruby_bug do + # http://rubyforge.org/tracker/index.php?func=detail&aid=19377&group_id=426&atid=1698 + it "returns the singleton instance" do + instance = SingletonSpecs::MyClass.instance + instance.equal?(Marshal.load(Marshal.dump(instance))).should == true + end + end +end
This paste will be private.
From the Design Piracy series on my blog: