diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-12-09 15:12:51 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-12-09 16:36:22 +0900 |
commit | 0677bbe3ff139a4f369c128bdab3526450c5ee6f (patch) | |
tree | d114f89cd3150e50cfeaa3d20542287dcacf85ae /spec/syntax_suggest/integration/ruby_command_line_spec.rb | |
parent | 9557c8edf2dcf18fdece066c596a71696b2f2b30 (diff) |
Merge syntax_suggest master
Pick from https://github.com/ruby/syntax_suggest/commit/daee74dcb06296fa69fe8595fdff5d93d432b30d
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6890
Diffstat (limited to 'spec/syntax_suggest/integration/ruby_command_line_spec.rb')
-rw-r--r-- | spec/syntax_suggest/integration/ruby_command_line_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/syntax_suggest/integration/ruby_command_line_spec.rb b/spec/syntax_suggest/integration/ruby_command_line_spec.rb index 9e488df93a..5c7ee06d83 100644 --- a/spec/syntax_suggest/integration/ruby_command_line_spec.rb +++ b/spec/syntax_suggest/integration/ruby_command_line_spec.rb @@ -76,9 +76,17 @@ module SyntaxSuggest end end - it "annotates a syntax error in Ruby 3.2+ when require is not used" do - pending("Support for SyntaxError#detailed_message monkeypatch needed https://gist.github.com/schneems/09f45cc23b9a8c46e9af6acbb6e6840d?permalink_comment_id=4172585#gistcomment-4172585") + it "gem can be tested when executing on Ruby with default gem included" do + skip if ruby_core? + skip if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.2") + + out = `ruby -I#{lib_dir} -rsyntax_suggest -e "puts SyntaxError.instance_method(:detailed_message).source_location" 2>&1` + expect($?.success?).to be_truthy + expect(out).to include(lib_dir.join("syntax_suggest").join("core_ext.rb").to_s).once + end + + it "annotates a syntax error in Ruby 3.2+ when require is not used" do skip if ruby_core? skip if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.2") |