From 4d51a0b495262073a8c1c0c9d7f276c4e6260688 Mon Sep 17 00:00:00 2001 From: schneems Date: Fri, 25 Nov 2022 16:12:30 -0600 Subject: [PATCH] [ruby/syntax_suggest] Failing test for #157 https://github.com/ruby/syntax_suggest/commit/14e8cdc916 --- .../integration/ruby_command_line_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/syntax_suggest/integration/ruby_command_line_spec.rb b/spec/syntax_suggest/integration/ruby_command_line_spec.rb index 6ed1bf0bf7..0488de879f 100644 --- a/spec/syntax_suggest/integration/ruby_command_line_spec.rb +++ b/spec/syntax_suggest/integration/ruby_command_line_spec.rb @@ -150,5 +150,21 @@ module SyntaxSuggest expect(out).to_not include("Could not find filename") end end + + it "does not say 'syntax ok' when a syntax error fires" do + Dir.mktmpdir do |dir| + tmpdir = Pathname(dir) + script = tmpdir.join("script.rb") + script.write <<~'EOM' + break + EOM + + out = `ruby -I#{lib_dir} -rsyntax_suggest -e "require_relative '#{script}'" 2>&1` + + expect($?.success?).to be_falsey + expect(out.downcase).to_not include("syntax ok") + puts out + end + end end end