Skip to content

Commit 175b6f7

Browse files
author
Aryan Soni
committed
Update document symbol test names to be less specific
1 parent 35d361c commit 175b6f7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/ruby_lsp_rails/document_symbol_test.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class NestedTest < ActiveSupport::TestCase
163163
assert_equal("back to the same level", response[0].children[2].name)
164164
end
165165

166-
test "correctly handles model callbacks with multiple Prism::StringNode arguments" do
166+
test "correctly handles model callbacks with multiple string arguments" do
167167
response = generate_document_symbols_for_source(<<~RUBY)
168168
class FooModel < ApplicationRecord
169169
before_save "foo_method", "bar_method", on: :update
@@ -192,7 +192,7 @@ class FooController < ApplicationController
192192
assert_equal("before_action(<anonymous>)", response[0].children[0].name)
193193
end
194194

195-
test "correctly handles job callback with Prism::SymbolNode argument" do
195+
test "correctly handles job callback with symbol argument" do
196196
response = generate_document_symbols_for_source(<<~RUBY)
197197
class FooJob < ApplicationJob
198198
before_perform :foo_method
@@ -205,7 +205,7 @@ class FooJob < ApplicationJob
205205
assert_equal("before_perform(foo_method)", response[0].children[0].name)
206206
end
207207

208-
test "correctly handles model callback with Prism::LambdaNode argument" do
208+
test "correctly handles model callback with lambda argument" do
209209
response = generate_document_symbols_for_source(<<~RUBY)
210210
class FooModel < ApplicationRecord
211211
before_save -> () {}
@@ -218,7 +218,7 @@ class FooModel < ApplicationRecord
218218
assert_equal("before_save(<anonymous>)", response[0].children[0].name)
219219
end
220220

221-
test "correctly handles job callbacks with Prism::CallNode argument" do
221+
test "correctly handles job callbacks with method call argument" do
222222
response = generate_document_symbols_for_source(<<~RUBY)
223223
class FooJob < ApplicationJob
224224
before_perform FooClass.new(foo_arg)
@@ -231,7 +231,7 @@ class FooJob < ApplicationJob
231231
assert_equal("before_perform(FooClass)", response[0].children[0].name)
232232
end
233233

234-
test "correctly handles controller callbacks with Prism::ConstantReadNode argument" do
234+
test "correctly handles controller callbacks with constant argument" do
235235
response = generate_document_symbols_for_source(<<~RUBY)
236236
class FooController < ApplicationController
237237
before_action FooClass
@@ -244,7 +244,7 @@ class FooController < ApplicationController
244244
assert_equal("before_action(FooClass)", response[0].children[0].name)
245245
end
246246

247-
test "correctly handles model callbacks with Prism::ConstantPathNode argument" do
247+
test "correctly handles model callbacks with namespaced constant argument" do
248248
response = generate_document_symbols_for_source(<<~RUBY)
249249
class FooModel < ApplicationRecord
250250
before_save Foo::BarClass
@@ -305,7 +305,7 @@ class FooModel < ApplicationRecord
305305
assert_equal("validate(Foo::BarClass)", response[0].children[5].name)
306306
end
307307

308-
test "correctly handles validates method with Prism::StringNode and Prism::SymbolNode argument types" do
308+
test "correctly handles validates method with string and symbol argument types" do
309309
response = generate_document_symbols_for_source(<<~RUBY)
310310
class FooModel < ApplicationRecord
311311
validates "foo_arg", :bar_arg
@@ -319,7 +319,7 @@ class FooModel < ApplicationRecord
319319
assert_equal("validates(bar_arg)", response[0].children[1].name)
320320
end
321321

322-
test "correctly handles validates_each method with Prism::StringNode and Prism::SymbolNode argument types" do
322+
test "correctly handles validates_each method with string and symbol argument types" do
323323
response = generate_document_symbols_for_source(<<~RUBY)
324324
class FooModel < ApplicationRecord
325325
validates_each "foo_arg", :bar_arg do
@@ -335,7 +335,7 @@ class FooModel < ApplicationRecord
335335
assert_equal("validates_each(bar_arg)", response[0].children[1].name)
336336
end
337337

338-
test "correctly handles validates_with method with Prism::ConstantReadNode and Prism::ConstantPathNode argument types" do
338+
test "correctly handles validates_with method with constant and namespaced constant argument types" do
339339
response = generate_document_symbols_for_source(<<~RUBY)
340340
class FooModel < ApplicationRecord
341341
validates_with FooClass, Foo::BarClass

0 commit comments

Comments
 (0)