git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-08-27 14:49:56 +00:00
parent 35f2b71ce9
commit 85d1a8ba3b
3 changed files with 8 additions and 4 deletions

View File

@ -32,7 +32,14 @@ describe "The DATA constant" do
end
it "is set even if there is no newline after __END__" do
ruby_exe(fixture(__FILE__, "no_newline_data.rb")).should == "30\n\"\"\n"
path = tmp("no_newline_data.rb")
code = File.read(fixture(__FILE__, "empty_data.rb"))
touch(path) { |f| f.write code.chomp }
begin
ruby_exe(path).should == "30\n\"\"\n"
ensure
rm_r path
end
end
it "rewinds to the head of the main script" do

View File

@ -1,3 +0,0 @@
p DATA.pos
p DATA.read
__END__