aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/test_singleton.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_singleton.rb b/test/test_singleton.rb
new file mode 100644
index 0000000000..bd11095cf2
--- /dev/null
+++ b/test/test_singleton.rb
@@ -0,0 +1,15 @@
+require 'test/unit'
+require 'singleton'
+
+class TestSingleton < Test::Unit::TestCase
+ class C
+ include Singleton
+ end
+
+ def test_marshal
+ o1 = C.instance
+ m = Marshal.dump(o1)
+ o2 = Marshal.load(m)
+ assert_same(o1, o2)
+ end
+end