diff options
Diffstat (limited to 'test/ruby/test_beginendblock.rb')
-rw-r--r-- | test/ruby/test_beginendblock.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb index 463ebd94b6..caed180613 100644 --- a/test/ruby/test_beginendblock.rb +++ b/test/ruby/test_beginendblock.rb @@ -41,6 +41,12 @@ class TestBeginEndBlock < Test::Unit::TestCase end end + def test_begininclass + assert_raise(SyntaxError) do + eval("class TestBeginEndBlock; BEGIN {}; end") + end + end + def test_endblockwarn ruby = EnvUtil.rubybin # Use Tempfile to create temporary file path. @@ -74,8 +80,8 @@ EOW '-e', 'raise %[SomethingElse]']) {|f| f.read } - assert_match /SomethingBad/, out, "[ruby-core:9675]" - assert_match /SomethingElse/, out, "[ruby-core:9675]" + assert_match(/SomethingBad/, out, "[ruby-core:9675]") + assert_match(/SomethingElse/, out, "[ruby-core:9675]") end def test_should_propagate_exit_code @@ -93,7 +99,7 @@ EOW '-e', 'at_exit{Process.kill(:INT, $$); loop{}}']) {|f| f.read } - assert_match /Interrupt$/, out + assert_match(/Interrupt$/, out) Process.kill(0, 0) rescue return # check if signal works assert_nil $?.exitstatus assert_equal Signal.list["INT"], $?.termsig |