From d1dd727533a1df1b59553b5d3feec87bb1dd951f Mon Sep 17 00:00:00 2001 From: mame Date: Sun, 13 Jun 2010 06:47:44 +0000 Subject: * 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 --- ChangeLog | 5 +++++ test/ruby/test_rubyoptions.rb | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8e9a15f8e4..8a9099a62a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jun 13 15:46:07 2010 Yusuke Endoh + + * test/ruby/test_rubyoptions.rb: add a simple test for __END__ and + DATA. + Sun Jun 13 04:24:18 2010 Marc-Andre Lafortune * lib/delegate.rb: Delegate !=, eql? and hash [ruby-core:26139] diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 03cea47ea9..afa5039353 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -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 -- cgit v1.2.3