diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0da09c120..8cacb1c73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,6 @@ jobs: bundle exec appraisal rails-${{ matrix.rails_version }} bundle --quiet MEASURE_COVERAGE=true bundle exec appraisal rails-${{ matrix.rails_version }} rake all_tests env: - RAISE_ON_WARNING: 1 RAILS_VERSION: ${{ matrix.rails_version }} RUBY_VERSION: ${{ matrix.ruby_version }} - name: Upload coverage results diff --git a/Gemfile.lock b/Gemfile.lock index 83b88639c..2d7546d0a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -272,7 +272,7 @@ GEM tsort (>= 0.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.3.1) + rake (13.4.1) rdoc (7.2.0) erb psych (>= 4.0.0) @@ -559,7 +559,7 @@ CHECKSUMS rails-html-sanitizer (1.7.0) sha256=28b145cceaf9cc214a9874feaa183c3acba036c9592b19886e0e45efc62b1e89 railties (8.1.3) sha256=913eb0e0cb520aac687ffd74916bd726d48fa21f47833c6292576ef6a286de22 rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a - rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c + rake (13.4.1) sha256=b4e81bd6a748308a6799619d824ec6a23cd1acd07d9ec41e5f2ebfb2294447c8 rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192 reactionview (0.3.0) sha256=3bd363863776827eaf85a9baf75370c1ca52a4b0dad87ba5d672e4abe76eb640 redis (5.4.1) sha256=b5e675b57ad22b15c9bcc765d5ac26f60b675408af916d31527af9bd5a81faae diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 22893355a..55850f655 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,6 +6,18 @@ require "bundler/setup" +module Warning + PROJECT_ROOT = File.expand_path("..", __dir__).freeze + + def self.warn(message) + called_by = caller_locations(1, 1).first.path + return super unless called_by&.start_with?(PROJECT_ROOT) && !called_by.start_with?("#{PROJECT_ROOT}/vendor") + return if message.include?("Template format for") + + raise "Warning: #{message}" + end +end + # Configure Rails Environment ENV["RAILS_ENV"] = "test" diff --git a/test/test_helper.rb b/test/test_helper.rb index f6ddbd2e5..e6f37b985 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -7,17 +7,15 @@ require "minitest/autorun" require "minitest/mock" -if ENV["RAISE_ON_WARNING"] - module Warning - PROJECT_ROOT = File.expand_path("..", __dir__).freeze +module Warning + PROJECT_ROOT = File.expand_path("..", __dir__).freeze - def self.warn(message) - called_by = caller_locations(1, 1).first.path - return super unless called_by&.start_with?(PROJECT_ROOT) && !called_by.start_with?("#{PROJECT_ROOT}/vendor") - return super if message.include?("Template format for") + def self.warn(message) + called_by = caller_locations(1, 1).first.path + return super unless called_by&.start_with?(PROJECT_ROOT) && !called_by.start_with?("#{PROJECT_ROOT}/vendor") + return if message.include?("Template format for") - raise "Warning: #{message}" - end + raise "Warning: #{message}" end end