use tempfile module

This commit is contained in:
take_cheeze
2014-03-03 17:01:47 +09:00
parent fa5c3d4f51
commit 24e3e33cb6
+6 -3
View File
@@ -1,3 +1,5 @@
require 'tempfile'
assert('regression for #1564') do
o = `bin/mruby -e '<<' 2>&1`
assert_equal o, "-e:1:2: syntax error, unexpected tLSHFT\n"
@@ -6,8 +8,9 @@ assert('regression for #1564') do
end
assert('regression for #1572') do
system "echo 'p \"ok\"' > /tmp/1572.rb"
system "bin/mrbc -g -o /tmp/1572.mrb /tmp/1572.rb"
o = `bin/mruby -b /tmp/1572.mrb`.strip
script, bin = Tempfile.new('test.rb'), Tempfile.new('test.mrb')
system "echo 'p \"ok\"' > #{script.path}"
system "bin/mrbc -g -o #{bin.path} #{script.path}"
o = `bin/mruby -b #{bin.path}`.strip
assert_equal o, '"ok"'
end