Improve Solargraph LSP in our spec files

The main thing is that I was getting "RequireNotFound" warnings for
`require 'rails_helper'`, because the LSP seems unaware of how RSpec
offers `spec/` as a root for requires.

I think the `require_relative` is clearer anyway, I'm decently
satisfied with it. And if I decide it's too much ugly, we can try
something else in the Solargraph config or something sometime!
This commit is contained in:
Emi Matchu 2024-11-19 11:28:36 -08:00
parent bc0097850d
commit 218dc5b6f9
7 changed files with 10 additions and 7 deletions

1
.gitignore vendored
View file

@ -5,6 +5,7 @@ tmp/**/*
.env
.env.*
/spec/examples.txt
/.yardoc
/app/assets/builds/*
!/app/assets/builds/.keep

View file

@ -84,8 +84,10 @@ gem "sentry-rails", "~> 5.12"
gem "shell", "~> 0.8.1"
# For workspace autocomplete.
gem "solargraph", "~> 0.50.0", group: :development
gem "solargraph-rails", "~> 1.1", group: :development
group :development do
gem "solargraph", "~> 0.50.0"
gem "solargraph-rails", "~> 1.1"
end
# For automated tests.
group :development, :test do

View file

@ -1,4 +1,4 @@
require 'rails_helper'
require_relative '../rails_helper'
RSpec.describe Color do
fixtures :colors

View file

@ -1,4 +1,4 @@
require 'rails_helper'
require_relative '../rails_helper'
require_relative '../support/mocks/custom_pets'
require_relative '../support/matchers/a_record_matching'

View file

@ -1,4 +1,4 @@
require 'rails_helper'
require_relative '../rails_helper'
RSpec.describe PetType do
fixtures :colors, :species, :pet_types

View file

@ -1,4 +1,4 @@
require 'rails_helper'
require_relative '../rails_helper'
RSpec.describe Species do
fixtures :species

View file

@ -1,5 +1,5 @@
require 'rails_helper'
require 'webmock/rspec'
require_relative '../rails_helper'
RSpec.describe Neopets::NCMall, type: :model do
describe ".load_styles" do