Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
16 changes: 7 additions & 9 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading