* test/ruby/test_rubyoptions.rb: add a simple test for __END__ and

DATA.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-06-13 06:47:44 +00:00
parent 58f779170d
commit d1dd727533
2 changed files with 18 additions and 0 deletions

View file

@ -401,4 +401,17 @@ class TestRubyOptions < Test::Unit::TestCase
nil,
opts)
end
def test_DATA
t = Tempfile.new(["test_ruby_test_rubyoption", ".rb"])
t.puts "puts DATA.read.inspect"
t.puts "__END__"
t.puts "foo"
t.puts "bar"
t.puts "baz"
t.close
assert_in_out_err([t.path], "", %w("foo\\nbar\\nbaz\\n"), [])
ensure
t.close(true) if t
end
end