aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_singleton.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-03 12:10:30 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-03 12:10:30 +0000
commit55b95b0169fee1cf10f8c67ead1c93e16a686194 (patch)
treeba43636a127c262045c3620875a5178e14e3ab32 /test/test_singleton.rb
parent1aa2d2976fac9a8ec46e3cb7ec5d92dae8f0c61c (diff)
downloadruby-55b95b0169fee1cf10f8c67ead1c93e16a686194.tar.gz
new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_singleton.rb')
-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