Skip to content

Commit

Permalink
Temporarily rename the .ruby-version file to pass CI for rubocop-old
Browse files Browse the repository at this point in the history
Old versions of rubocop read the ruby version from .ruby-version first.
We made the change upstream which is not captured in versions of
rubocop (< 0.87).

Upstream commit: rubocop/rubocop@02b2c3a

Co-authored-by: Étienne Barrié <etienne.barrie@shopify.com>
  • Loading branch information
george-ma and etiennebarrie committed Mar 18, 2024
1 parent 5a416e0 commit ecfebbf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/erb_lint/linters/rubocop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
before { linter.run(processed_source) }

context "config is valid when rubocop_config is not explicitly provided" do
before(:all) { File.rename(".ruby-version", ".ruby-version.bak") }
after(:all) { File.rename(".ruby-version.bak", ".ruby-version") }

let(:linter_config) do
described_class.config_schema.new(only: ["NotALinter"])
end
Expand Down Expand Up @@ -232,6 +235,9 @@
end

context "supports config from a provided path" do
before(:all) { File.rename(".ruby-version", ".ruby-version.bak") }
after(:all) { File.rename(".ruby-version.bak", ".ruby-version") }

after do
config_file.close
config_file.unlink
Expand Down

0 comments on commit ecfebbf

Please sign in to comment.