Skip to content

Commit

Permalink
Add test to check that it warns when using the deprecated config
Browse files Browse the repository at this point in the history
  • Loading branch information
george-ma committed Jul 24, 2024
1 parent 69cb011 commit 8972838
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/erb_lint/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ def run(processed_source)
end
end

context "with deprecated config file" do
let(:deprecated_config_filename) { ".erb-lint.yml" }
let(:config_file_content) { "------\nEnableDefaultLinters: true\n" }

before do
FileUtils.mkdir_p(File.dirname(deprecated_config_filename))
File.write(deprecated_config_filename, config_file_content)
end

it "shows a warning but loads the deprecated config file" do
expect { cli.run(args) }.to(output(/#{Regexp.escape(deprecated_config_filename)} is deprecated/).to_stderr)
end
end

context "with --disable-inline-configs" do
module ERBLint
module Linters
Expand Down

0 comments on commit 8972838

Please sign in to comment.