Skip to content

Commit

Permalink
Avoid using stubs in test_helper.rb as it depends on Mocha (#2474)
Browse files Browse the repository at this point in the history
Avoid using stubs in test_helper.rb because it's from Mocha
  • Loading branch information
st0012 authored Aug 21, 2024
1 parent 980440b commit ac0b1e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ruby_lsp/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module TestHelper
def with_server(source = nil, uri = Kernel.URI("file:///fake.rb"), stub_no_typechecker: false, load_addons: true,
&block)
server = RubyLsp::Server.new(test_mode: true)
server.global_state.stubs(:has_type_checker).returns(false) if stub_no_typechecker
server.global_state.apply_options({ initializationOptions: { experimentalFeaturesEnabled: true } })
server.global_state.instance_variable_set(:@has_type_checker, false) if stub_no_typechecker
language_id = uri.to_s.end_with?(".erb") ? "erb" : "ruby"

if source
Expand Down

0 comments on commit ac0b1e6

Please sign in to comment.