summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_beginendblock.rb3
-rw-r--r--test/ruby/test_marshal.rb13
2 files changed, 14 insertions, 2 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb
index c7296a4e85..deacc782b7 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -39,8 +39,7 @@ STDERR.reopen(File.open(errout, "w"))
STDERR.sync = true
Dir.chdir(#{q(DIR)})
cmd = "\\"#{ruby}\\" \\"endblockwarn.rb\\""
-exec(cmd)
-exit!("must not reach here")
+system(cmd)
EOF
launcher.close
launcherpath = launcher.path
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index e4e4cc3c6a..ac804eb24c 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -252,6 +252,19 @@ module MarshalTestLib
marshal_equal(o) {|obj| class << obj; ancestors end}
end
+ def test_extend_string
+ o = String.new
+ o.extend Mod1
+ marshal_equal(o) { |obj| obj.kind_of? Mod1 }
+ o = String.new
+ o.extend Module.new
+ assert_raises(TypeError) { marshaltest(o) }
+ o = String.new
+ o.extend Mod1
+ o.extend Mod2
+ marshal_equal(o) {|obj| class << obj; ancestors end}
+ end
+
def test_anonymous
c = Class.new
assert_raises(TypeError) { marshaltest(c) }