aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_beginendblock.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-31 15:02:22 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-31 15:02:22 +0000
commita3e1b1ce7ed7e7ffac23015fc2fde56511b30681 (patch)
tree7b725552a9a4ded93849ca2faab1b257f7761790 /test/ruby/test_beginendblock.rb
parent3e7566d8fb5138bb9cd647e5fdefc54fc9803509 (diff)
downloadruby-a3e1b1ce7ed7e7ffac23015fc2fde56511b30681.tar.gz
* Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_beginendblock.rb')
-rw-r--r--test/ruby/test_beginendblock.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb
index a8e5913b10..82b8880894 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -12,9 +12,9 @@ class TestBeginEndBlock < Test::Unit::TestCase
def test_beginendblock
ruby = EnvUtil.rubybin
target = File.join(DIR, 'beginmainend.rb')
- io = IO.popen("#{q(ruby)} #{q(target)}")
- assert_equal(%w(b1 b2-1 b2 main b3-1 b3 b4 e1 e4 e3 e2 e4-2 e4-1 e1-1 e4-1-1), io.read.split)
- io.close
+ IO.popen("#{q(ruby)} #{q(target)}"){|io|
+ assert_equal(%w(b1 b2-1 b2 main b3-1 b3 b4 e1 e4 e3 e2 e4-2 e4-1 e1-1 e4-1-1), io.read.split)
+ }
end
def test_begininmethod
@@ -46,11 +46,16 @@ EOF
errout.close
erroutpath = errout.path
system("#{q(ruby)} #{q(launcherpath)} #{q(erroutpath)}")
+# expected = <<EOW
+#endblockwarn.rb:2: warning: END in method; use at_exit
+#(eval):2: warning: END in method; use at_exit
+#EOW
expected = <<EOW
-endblockwarn.rb:2: warning: END in method; use at_exit
-(eval):2: warning: END in method; use at_exit
+warning: END in method; use at_exit
+warning: END in method; use at_exit
EOW
assert_equal(expected, File.read(erroutpath))
# expecting Tempfile to unlink launcher and errout file.
end
+
end