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:
parent
bc0097850d
commit
218dc5b6f9
7 changed files with 10 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,6 +5,7 @@ tmp/**/*
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
/spec/examples.txt
|
/spec/examples.txt
|
||||||
|
/.yardoc
|
||||||
|
|
||||||
/app/assets/builds/*
|
/app/assets/builds/*
|
||||||
!/app/assets/builds/.keep
|
!/app/assets/builds/.keep
|
||||||
|
|
6
Gemfile
6
Gemfile
|
@ -84,8 +84,10 @@ gem "sentry-rails", "~> 5.12"
|
||||||
gem "shell", "~> 0.8.1"
|
gem "shell", "~> 0.8.1"
|
||||||
|
|
||||||
# For workspace autocomplete.
|
# For workspace autocomplete.
|
||||||
gem "solargraph", "~> 0.50.0", group: :development
|
group :development do
|
||||||
gem "solargraph-rails", "~> 1.1", group: :development
|
gem "solargraph", "~> 0.50.0"
|
||||||
|
gem "solargraph-rails", "~> 1.1"
|
||||||
|
end
|
||||||
|
|
||||||
# For automated tests.
|
# For automated tests.
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require 'rails_helper'
|
require_relative '../rails_helper'
|
||||||
|
|
||||||
RSpec.describe Color do
|
RSpec.describe Color do
|
||||||
fixtures :colors
|
fixtures :colors
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require 'rails_helper'
|
require_relative '../rails_helper'
|
||||||
require_relative '../support/mocks/custom_pets'
|
require_relative '../support/mocks/custom_pets'
|
||||||
require_relative '../support/matchers/a_record_matching'
|
require_relative '../support/matchers/a_record_matching'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require 'rails_helper'
|
require_relative '../rails_helper'
|
||||||
|
|
||||||
RSpec.describe PetType do
|
RSpec.describe PetType do
|
||||||
fixtures :colors, :species, :pet_types
|
fixtures :colors, :species, :pet_types
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require 'rails_helper'
|
require_relative '../rails_helper'
|
||||||
|
|
||||||
RSpec.describe Species do
|
RSpec.describe Species do
|
||||||
fixtures :species
|
fixtures :species
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
require 'rails_helper'
|
|
||||||
require 'webmock/rspec'
|
require 'webmock/rspec'
|
||||||
|
require_relative '../rails_helper'
|
||||||
|
|
||||||
RSpec.describe Neopets::NCMall, type: :model do
|
RSpec.describe Neopets::NCMall, type: :model do
|
||||||
describe ".load_styles" do
|
describe ".load_styles" do
|
||||||
|
|
Loading…
Reference in a new issue