summaryrefslogtreecommitdiff
path: root/spec/syntax_suggest/integration
diff options
context:
space:
mode:
Diffstat (limited to 'spec/syntax_suggest/integration')
-rw-r--r--spec/syntax_suggest/integration/ruby_command_line_spec.rb4
-rw-r--r--spec/syntax_suggest/integration/syntax_suggest_spec.rb29
2 files changed, 25 insertions, 8 deletions
diff --git a/spec/syntax_suggest/integration/ruby_command_line_spec.rb b/spec/syntax_suggest/integration/ruby_command_line_spec.rb
index c1ec4be54e..02354ceff0 100644
--- a/spec/syntax_suggest/integration/ruby_command_line_spec.rb
+++ b/spec/syntax_suggest/integration/ruby_command_line_spec.rb
@@ -94,8 +94,6 @@ module SyntaxSuggest
end
it "gem can be tested when executing on Ruby with default gem included" do
- 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
@@ -103,8 +101,6 @@ module SyntaxSuggest
end
it "annotates a syntax error in Ruby 3.2+ when require is not used" do
- skip if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.2")
-
Dir.mktmpdir do |dir|
tmpdir = Pathname(dir)
script = tmpdir.join("script.rb")
diff --git a/spec/syntax_suggest/integration/syntax_suggest_spec.rb b/spec/syntax_suggest/integration/syntax_suggest_spec.rb
index 9071d37c1b..de9bc5d38e 100644
--- a/spec/syntax_suggest/integration/syntax_suggest_spec.rb
+++ b/spec/syntax_suggest/integration/syntax_suggest_spec.rb
@@ -13,7 +13,7 @@ module SyntaxSuggest
io = StringIO.new
- benchmark = Benchmark.measure do
+ benchmark_measure do
debug_perf do
SyntaxSuggest.call(
io: io,
@@ -24,7 +24,6 @@ module SyntaxSuggest
end
debug_display(io.string)
- debug_display(benchmark)
expect(io.string).to include(<<~EOM)
6 class SyntaxTree < Ripper
@@ -42,7 +41,7 @@ module SyntaxSuggest
io = StringIO.new
debug_perf do
- benchmark = Benchmark.measure do
+ benchmark_measure do
SyntaxSuggest.call(
io: io,
source: file.read,
@@ -50,7 +49,6 @@ module SyntaxSuggest
)
end
debug_display(io.string)
- debug_display(benchmark)
end
expect(io.string).to_not include("def ruby_install_binstub_path")
@@ -205,6 +203,29 @@ module SyntaxSuggest
EOM
end
+ it "multi-line chain with missing paren" do
+ source = <<~EOM
+ class Dog
+ def bark
+ User
+ .where(name: "schneems"
+ .first
+ end
+ end
+ EOM
+ io = StringIO.new
+ SyntaxSuggest.call(
+ io: io,
+ source: source
+ )
+ out = io.string
+ expect(out).to include(<<~EOM)
+ > 3 User
+ > 4 .where(name: "schneems"
+ > 5 .first
+ EOM
+ end
+
it "empty else" do
source = <<~EOM
class Foo