Skip to content

Commit 3265ff3

Browse files
committed
Fix constant lookup for Parser::Ruby::RubyParser
Previously I was seeing errors like this when running this spec: NameError: uninitialized constant YARD::Tags::TypesExplainer::Parser::Ruby Ruby v4.0 seems to have changed constant lookup slightly so the less-qualified constant wasn't working any more. The fully-qualified version was already being used in other specs, so this make the specs more consistent.
1 parent 9b99dee commit 3265ff3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/handlers/ruby/base_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class StringHandler < Handlers::Ruby::Base
3737
handles "x"
3838
end
3939
allow(Handlers::Base).to receive(:subclasses).and_return [StringHandler]
40-
ast = Parser::Ruby::RubyParser.parse("if x == 2 then true end").ast
40+
ast = YARD::Parser::Ruby::RubyParser.parse("if x == 2 then true end").ast
4141
valid StringHandler, ast[0][0][0]
4242
invalid StringHandler, ast[0][1]
4343
end
@@ -56,7 +56,7 @@ class RegexHandler < Handlers::Ruby::Base
5656
handles(/^if x ==/)
5757
end
5858
allow(Handlers::Base).to receive(:subclasses).and_return [RegexHandler]
59-
ast = Parser::Ruby::RubyParser.parse("if x == 2 then true end").ast
59+
ast = YARD::Parser::Ruby::RubyParser.parse("if x == 2 then true end").ast
6060
valid RegexHandler, ast
6161
invalid RegexHandler, ast[0][1]
6262
end
@@ -75,7 +75,7 @@ class MethCallHandler < Handlers::Ruby::Base
7575
handles method_call(:meth)
7676
end
7777
allow(Handlers::Base).to receive(:subclasses).and_return [MethCallHandler]
78-
ast = Parser::Ruby::RubyParser.parse(<<-"eof").ast
78+
ast = YARD::Parser::Ruby::RubyParser.parse(<<-"eof").ast
7979
meth # 0
8080
meth() # 1
8181
meth(1,2,3) # 2

0 commit comments

Comments
 (0)