Skip to content

Commit

Permalink
Make sure the ruby test_file actually executes as a ruby script
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Bennett-Lovesey committed Aug 10, 2023
1 parent 303443e commit 1220d68
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
25 changes: 21 additions & 4 deletions goldens/test.rb.golden
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module Test::SubTest
class << self
# In all ways, this method behaves the same as `in_eigenclass`
def in_reopened_eigenclass
new.bar(true)
new.optional_param(true)
end
end

Expand Down Expand Up @@ -85,7 +85,7 @@ class MyClass < SomeClass
class << self
# In all ways, this method behaves the same as `in_eigenclass`
def in_reopened_eigenclass
new.bar(true)
new.optional_param(true)
end
end

Expand Down Expand Up @@ -115,9 +115,9 @@ Name: simple
Reference (reference.call):
new.simple

Name: bar
Name: optional_param
Reference (reference.call):
new.bar(true)
new.optional_param(true)

Name: unparenthesized
Parameters: arg1, arg2
Expand All @@ -143,6 +143,7 @@ module Test::SubTest::SubSubTest
module SubSubSubTest
extend SomeModule
end

end

Name: SubSubSubTest
Expand All @@ -160,3 +161,19 @@ extend SomeModule
Name: MyTerribleMethod
Reference (reference.call):
MyTerribleMethod()

Name: new
Reference (reference.call):
Test::SubTest::MyClass.new

Name: splatted_args
Reference (reference.call):
Test::SubTest::MyClass.new.splatted_args 1, 2, 3

Name: in_reopened_eigenclass
Reference (reference.call):
Test::SubTest::MyClass.in_reopened_eigenclass

Name: omitted_parens
Reference (reference.call):
Test::SubTest::SubSubTest::SubSubSubTest.omitted_parens
6 changes: 3 additions & 3 deletions queries/ruby_tags.scm
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
name: (_) @name
parameters: (method_parameters) @codeium.parameters
body: (_) @body
) @definition.method
)
(singleton_method
name: (_) @name
parameters: (method_parameters) @codeium.parameters
body: (_) @body
) @definition.method
]
)
] @definition.method
(#select-adjacent! @doc @definition.method)
)

Expand Down
8 changes: 7 additions & 1 deletion test_files/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.in_eigenclass
class << self
# In all ways, this method behaves the same as `in_eigenclass`
def in_reopened_eigenclass
new.bar(true)
new.optional_param(true)
end
end

Expand All @@ -57,9 +57,15 @@ module Test::SubTest::SubSubTest
module SubSubSubTest
extend SomeModule
end

end

def MyTerribleMethod
end


# Some calls, just to check everything works
MyTerribleMethod()
Test::SubTest::MyClass.new.splatted_args 1, 2, 3
Test::SubTest::MyClass.in_reopened_eigenclass
Test::SubTest::SubSubTest::SubSubSubTest.omitted_parens

0 comments on commit 1220d68

Please sign in to comment.