summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorschneems <richard.schneeman+foo@gmail.com>2023-03-09 14:13:46 -0600
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-04-06 15:45:29 +0900
commit63ea6b0cf2b7fd27e22dc7b468fe65ee2c79b23a (patch)
treecd71a5059b23d68e5fcb808499390d21897210af /spec
parent2acbcec056f54df9b4d98d4d15b1e9f612ac1432 (diff)
downloadruby-63ea6b0cf2b7fd27e22dc7b468fe65ee2c79b23a.tar.gz
[ruby/syntax_suggest] Rollback comment indentation behavior
Originally I fixed https://github.com/ruby/syntax_suggest/pull/177 by making the process of comment removal indentation aware. The next commit is the more general fix and means we don't need to carry that additional logic/overhead. Also: Update syntax via linter
Diffstat (limited to 'spec')
-rw-r--r--spec/syntax_suggest/unit/block_expand_spec.rb4
-rw-r--r--spec/syntax_suggest/unit/clean_document_spec.rb3
2 files changed, 3 insertions, 4 deletions
diff --git a/spec/syntax_suggest/unit/block_expand_spec.rb b/spec/syntax_suggest/unit/block_expand_spec.rb
index 4f93210368..5cff73621d 100644
--- a/spec/syntax_suggest/unit/block_expand_spec.rb
+++ b/spec/syntax_suggest/unit/block_expand_spec.rb
@@ -28,9 +28,9 @@ module SyntaxSuggest
block = expansion.expand_neighbors(block)
expect(block.to_s).to eq(<<~EOM.indent(2))
- def bark # index 1
+ def bark # index 1
- end # index 3
+ end # index 3
EOM
end
diff --git a/spec/syntax_suggest/unit/clean_document_spec.rb b/spec/syntax_suggest/unit/clean_document_spec.rb
index bb26e2f392..25a62e4454 100644
--- a/spec/syntax_suggest/unit/clean_document_spec.rb
+++ b/spec/syntax_suggest/unit/clean_document_spec.rb
@@ -72,7 +72,6 @@ module SyntaxSuggest
EOM
end
-
it "joins multi-line chained methods when separated by comments" do
source = <<~EOM
User.
@@ -114,7 +113,7 @@ module SyntaxSuggest
lines = CleanDocument.new(source: source).lines
expect(lines[0].to_s).to eq($/)
expect(lines[1].to_s).to eq('puts "what"' + $/)
- expect(lines[2].to_s).to eq(' ' + $/)
+ expect(lines[2].to_s).to eq($/)
end
it "trailing slash: does not join trailing do" do