2018-03-04 15:09:32 +00:00
|
|
|
require_relative '../spec_helper'
|
2017-05-07 12:04:49 +00:00
|
|
|
|
|
|
|
describe "The interpreter" do
|
|
|
|
it "prints an error when given a file with invalid syntax" do
|
2021-06-02 14:34:07 +02:00
|
|
|
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), args: "2>&1", exit_status: 1)
|
2017-05-07 12:04:49 +00:00
|
|
|
out.should include "syntax error"
|
|
|
|
end
|
|
|
|
|
|
|
|
it "prints an error when given code via -e with invalid syntax" do
|
2021-06-02 14:34:07 +02:00
|
|
|
out = ruby_exe(nil, args: "-e 'a{' 2>&1", exit_status: 1)
|
2017-05-07 12:04:49 +00:00
|
|
|
out.should include "syntax error"
|
|
|
|
end
|
|
|
|
end
|