diff options
Diffstat (limited to 'spec/syntax_suggest/unit/code_line_spec.rb')
| -rw-r--r-- | spec/syntax_suggest/unit/code_line_spec.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/syntax_suggest/unit/code_line_spec.rb b/spec/syntax_suggest/unit/code_line_spec.rb index 5b62cc2757..309d3d1c1e 100644 --- a/spec/syntax_suggest/unit/code_line_spec.rb +++ b/spec/syntax_suggest/unit/code_line_spec.rb @@ -17,8 +17,6 @@ module SyntaxSuggest end it "supports endless method definitions" do - skip("Unsupported ruby version") unless Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3") - line = CodeLine.from_source(<<~EOM).first def square(x) = x * x EOM @@ -46,7 +44,7 @@ module SyntaxSuggest EOM # Indicates line 1 can join 2, 2 can join 3, but 3 won't join it's next line - expect(code_lines.map(&:ignore_newline_not_beg?)).to eq([true, true, false, false]) + expect(code_lines.map(&:consecutive?)).to eq([true, true, false, false]) end it "trailing if" do @@ -131,14 +129,15 @@ module SyntaxSuggest it "knows empty lines" do code_lines = CodeLine.from_source(<<~EOM) - # Not empty + # Comment only + foo # Inline comment - # Not empty + bar EOM - expect(code_lines.map(&:empty?)).to eq([false, true, false]) - expect(code_lines.map(&:not_empty?)).to eq([true, false, true]) - expect(code_lines.map { |l| SyntaxSuggest.valid?(l) }).to eq([true, true, true]) + expect(code_lines.map(&:empty?)).to eq([true, false, true, false]) + expect(code_lines.map(&:not_empty?)).to eq([false, true, false, true]) + expect(code_lines.map { |l| SyntaxSuggest.valid?(l) }).to eq([true, true, true, true]) end it "counts indentations" do |
