Skip to content

Commit 5dabbdc

Browse files
committed
Fix test for Rails 7
1 parent d50b105 commit 5dabbdc

File tree

9 files changed

+97
-117
lines changed

9 files changed

+97
-117
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
source "https://rubygems.org"
44

55
gemspec
6+
gem "sprockets-rails"

Gemfile.lock

+88-91
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,108 @@
11
PATH
22
remote: .
33
specs:
4-
exception-track (1.2.0)
4+
exception-track (1.3.0)
55
kaminari (>= 0.15)
66
rails (>= 5.2)
77

88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
actioncable (6.1.0)
12-
actionpack (= 6.1.0)
13-
activesupport (= 6.1.0)
11+
actioncable (7.0.0)
12+
actionpack (= 7.0.0)
13+
activesupport (= 7.0.0)
1414
nio4r (~> 2.0)
1515
websocket-driver (>= 0.6.1)
16-
actionmailbox (6.1.0)
17-
actionpack (= 6.1.0)
18-
activejob (= 6.1.0)
19-
activerecord (= 6.1.0)
20-
activestorage (= 6.1.0)
21-
activesupport (= 6.1.0)
16+
actionmailbox (7.0.0)
17+
actionpack (= 7.0.0)
18+
activejob (= 7.0.0)
19+
activerecord (= 7.0.0)
20+
activestorage (= 7.0.0)
21+
activesupport (= 7.0.0)
2222
mail (>= 2.7.1)
23-
actionmailer (6.1.0)
24-
actionpack (= 6.1.0)
25-
actionview (= 6.1.0)
26-
activejob (= 6.1.0)
27-
activesupport (= 6.1.0)
23+
actionmailer (7.0.0)
24+
actionpack (= 7.0.0)
25+
actionview (= 7.0.0)
26+
activejob (= 7.0.0)
27+
activesupport (= 7.0.0)
2828
mail (~> 2.5, >= 2.5.4)
2929
rails-dom-testing (~> 2.0)
30-
actionpack (6.1.0)
31-
actionview (= 6.1.0)
32-
activesupport (= 6.1.0)
33-
rack (~> 2.0, >= 2.0.9)
30+
actionpack (7.0.0)
31+
actionview (= 7.0.0)
32+
activesupport (= 7.0.0)
33+
rack (~> 2.0, >= 2.2.0)
3434
rack-test (>= 0.6.3)
3535
rails-dom-testing (~> 2.0)
3636
rails-html-sanitizer (~> 1.0, >= 1.2.0)
37-
actiontext (6.1.0)
38-
actionpack (= 6.1.0)
39-
activerecord (= 6.1.0)
40-
activestorage (= 6.1.0)
41-
activesupport (= 6.1.0)
37+
actiontext (7.0.0)
38+
actionpack (= 7.0.0)
39+
activerecord (= 7.0.0)
40+
activestorage (= 7.0.0)
41+
activesupport (= 7.0.0)
42+
globalid (>= 0.6.0)
4243
nokogiri (>= 1.8.5)
43-
actionview (6.1.0)
44-
activesupport (= 6.1.0)
44+
actionview (7.0.0)
45+
activesupport (= 7.0.0)
4546
builder (~> 3.1)
4647
erubi (~> 1.4)
4748
rails-dom-testing (~> 2.0)
4849
rails-html-sanitizer (~> 1.1, >= 1.2.0)
49-
activejob (6.1.0)
50-
activesupport (= 6.1.0)
50+
activejob (7.0.0)
51+
activesupport (= 7.0.0)
5152
globalid (>= 0.3.6)
52-
activemodel (6.1.0)
53-
activesupport (= 6.1.0)
54-
activerecord (6.1.0)
55-
activemodel (= 6.1.0)
56-
activesupport (= 6.1.0)
57-
activestorage (6.1.0)
58-
actionpack (= 6.1.0)
59-
activejob (= 6.1.0)
60-
activerecord (= 6.1.0)
61-
activesupport (= 6.1.0)
62-
marcel (~> 0.3.1)
63-
mimemagic (~> 0.3.2)
64-
activesupport (6.1.0)
53+
activemodel (7.0.0)
54+
activesupport (= 7.0.0)
55+
activerecord (7.0.0)
56+
activemodel (= 7.0.0)
57+
activesupport (= 7.0.0)
58+
activestorage (7.0.0)
59+
actionpack (= 7.0.0)
60+
activejob (= 7.0.0)
61+
activerecord (= 7.0.0)
62+
activesupport (= 7.0.0)
63+
marcel (~> 1.0)
64+
mini_mime (>= 1.1.0)
65+
activesupport (7.0.0)
6566
concurrent-ruby (~> 1.0, >= 1.0.2)
6667
i18n (>= 1.6, < 2)
6768
minitest (>= 5.1)
6869
tzinfo (~> 2.0)
69-
zeitwerk (~> 2.3)
7070
builder (3.2.4)
71-
concurrent-ruby (1.1.7)
71+
concurrent-ruby (1.1.9)
7272
connection_pool (2.2.5)
7373
crass (1.0.6)
7474
erubi (1.10.0)
75-
globalid (0.4.2)
76-
activesupport (>= 4.2.0)
77-
i18n (1.8.5)
75+
globalid (1.0.0)
76+
activesupport (>= 5.0)
77+
i18n (1.8.11)
7878
concurrent-ruby (~> 1.0)
79-
kaminari (1.2.1)
79+
kaminari (1.2.2)
8080
activesupport (>= 4.1.0)
81-
kaminari-actionview (= 1.2.1)
82-
kaminari-activerecord (= 1.2.1)
83-
kaminari-core (= 1.2.1)
84-
kaminari-actionview (1.2.1)
81+
kaminari-actionview (= 1.2.2)
82+
kaminari-activerecord (= 1.2.2)
83+
kaminari-core (= 1.2.2)
84+
kaminari-actionview (1.2.2)
8585
actionview
86-
kaminari-core (= 1.2.1)
87-
kaminari-activerecord (1.2.1)
86+
kaminari-core (= 1.2.2)
87+
kaminari-activerecord (1.2.2)
8888
activerecord
89-
kaminari-core (= 1.2.1)
90-
kaminari-core (1.2.1)
91-
loofah (2.8.0)
89+
kaminari-core (= 1.2.2)
90+
kaminari-core (1.2.2)
91+
loofah (2.13.0)
9292
crass (~> 1.0.2)
9393
nokogiri (>= 1.5.9)
9494
mail (2.7.1)
9595
mini_mime (>= 0.1.1)
96-
marcel (0.3.3)
97-
mimemagic (~> 0.3.2)
96+
marcel (1.0.2)
9897
method_source (1.0.0)
99-
mimemagic (0.3.10)
100-
nokogiri (~> 1)
101-
rake
102-
mini_mime (1.0.2)
98+
mini_mime (1.1.2)
10399
mini_portile2 (2.6.1)
104-
minitest (5.14.2)
100+
minitest (5.15.0)
105101
mocha (1.13.0)
106102
mock_redis (0.19.0)
107103
mustermann (1.1.1)
108104
ruby2_keywords (~> 0.0.1)
109-
nio4r (2.5.4)
105+
nio4r (2.5.8)
110106
nokogiri (1.12.5)
111107
mini_portile2 (~> 2.6.1)
112108
racc (~> 1.4)
@@ -117,33 +113,33 @@ GEM
117113
rack
118114
rack-test (1.1.0)
119115
rack (>= 1.0, < 3)
120-
rails (6.1.0)
121-
actioncable (= 6.1.0)
122-
actionmailbox (= 6.1.0)
123-
actionmailer (= 6.1.0)
124-
actionpack (= 6.1.0)
125-
actiontext (= 6.1.0)
126-
actionview (= 6.1.0)
127-
activejob (= 6.1.0)
128-
activemodel (= 6.1.0)
129-
activerecord (= 6.1.0)
130-
activestorage (= 6.1.0)
131-
activesupport (= 6.1.0)
116+
rails (7.0.0)
117+
actioncable (= 7.0.0)
118+
actionmailbox (= 7.0.0)
119+
actionmailer (= 7.0.0)
120+
actionpack (= 7.0.0)
121+
actiontext (= 7.0.0)
122+
actionview (= 7.0.0)
123+
activejob (= 7.0.0)
124+
activemodel (= 7.0.0)
125+
activerecord (= 7.0.0)
126+
activestorage (= 7.0.0)
127+
activesupport (= 7.0.0)
132128
bundler (>= 1.15.0)
133-
railties (= 6.1.0)
134-
sprockets-rails (>= 2.0.0)
129+
railties (= 7.0.0)
135130
rails-dom-testing (2.0.3)
136131
activesupport (>= 4.2.0)
137132
nokogiri (>= 1.6)
138-
rails-html-sanitizer (1.3.0)
133+
rails-html-sanitizer (1.4.2)
139134
loofah (~> 2.3)
140-
railties (6.1.0)
141-
actionpack (= 6.1.0)
142-
activesupport (= 6.1.0)
135+
railties (7.0.0)
136+
actionpack (= 7.0.0)
137+
activesupport (= 7.0.0)
143138
method_source
144-
rake (>= 0.8.7)
139+
rake (>= 12.2)
145140
thor (~> 1.0)
146-
rake (13.0.1)
141+
zeitwerk (~> 2.5)
142+
rake (13.0.6)
147143
redis (4.5.1)
148144
redis-namespace (1.8.1)
149145
redis (>= 3.0.4)
@@ -165,21 +161,21 @@ GEM
165161
sprockets (4.0.2)
166162
concurrent-ruby (~> 1.0)
167163
rack (> 1, < 3)
168-
sprockets-rails (3.2.2)
169-
actionpack (>= 4.0)
170-
activesupport (>= 4.0)
164+
sprockets-rails (3.4.2)
165+
actionpack (>= 5.2)
166+
activesupport (>= 5.2)
171167
sprockets (>= 3.0.0)
172-
thor (1.0.1)
168+
thor (1.1.0)
173169
tilt (2.0.10)
174170
timecop (0.9.4)
175-
tzinfo (2.0.3)
171+
tzinfo (2.0.4)
176172
concurrent-ruby (~> 1.0)
177173
vegas (0.1.11)
178174
rack (>= 1.0.0)
179-
websocket-driver (0.7.3)
175+
websocket-driver (0.7.5)
180176
websocket-extensions (>= 0.1.0)
181177
websocket-extensions (0.1.5)
182-
zeitwerk (2.4.2)
178+
zeitwerk (2.5.2)
183179

184180
PLATFORMS
185181
ruby
@@ -191,6 +187,7 @@ DEPENDENCIES
191187
pg (>= 1)
192188
resque (~> 1.8.0)
193189
sidekiq (>= 5.0.4)
190+
sprockets-rails
194191
timecop (~> 0.9.0)
195192

196193
BUNDLED WITH

Rakefile

-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ rescue LoadError
66
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
77
end
88

9-
require "rdoc/task"
10-
11-
RDoc::Task.new(:rdoc) do |rdoc|
12-
rdoc.rdoc_dir = "rdoc"
13-
rdoc.title = "ExceptionTrack"
14-
rdoc.options << "--line-numbers"
15-
rdoc.rdoc_files.include("README.md")
16-
rdoc.rdoc_files.include("lib/**/*.rb")
17-
end
18-
199
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
2010
load "rails/tasks/engine.rake"
2111

gemfiles/Gemfile-7-0

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
source "https://rubygems.org"
22

33
gem "rails", "~> 7.0.0"
4+
gem "sprockets-rails"
45

56
gemspec path: "../"

lib/exception-track/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module ExceptionTrack
4-
VERSION = "1.2.0"
4+
VERSION = "1.3.0"
55
end

test/dummy/config/application.rb

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
require_relative "boot"
42

53
require "rails/all"
@@ -10,14 +8,10 @@
108
module Dummy
119
class Application < Rails::Application
1210
# Initialize configuration defaults for originally generated Rails version.
13-
config.load_defaults 5.0
11+
config.load_defaults Rails::VERSION::STRING.to_f
1412

1513
# Application configuration can go into files in config/initializers
1614
# -- all .rb files in that directory are automatically loaded after loading
1715
# the framework and any gems in your application.
1816
end
1917
end
20-
21-
ExceptionNotification.configure do |config|
22-
config.testing_mode = true
23-
end

test/dummy/config/boot.rb

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
44

55
require "bundler/setup" # Set up gems listed in the Gemfile.
6+
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)

test/exception_track_test.rb

-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,4 @@ class ExceptionTrack::Test < ActiveSupport::TestCase
1919
assert_equal false, config.enabled_env?(:development)
2020
assert_equal true, config.enabled_env?(:production)
2121
end
22-
23-
test "ExceptionNotification config db notifier" do
24-
assert_equal %i[db], ExceptionNotifier.notifiers
25-
end
2622
end

test/test_helper.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
# Configure Rails Environment
44
ENV["RAILS_ENV"] = "test"
55

6-
require File.expand_path("../test/dummy/config/environment.rb", __dir__)
6+
require_relative "../test/dummy/config/environment"
77
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
88
ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__)
99

10+
ExceptionNotifier.testing_mode!
11+
require "support/exception_notifier_helper"
12+
1013
require "minitest/autorun"
1114
require "mocha/minitest"
1215
require "rails/test_help"
1316

14-
ExceptionNotifier.testing_mode!
15-
require "support/exception_notifier_helper"
16-
1717
# Filter out Minitest backtrace while allowing backtrace from other libraries
1818
# to be shown.
1919
Minitest.backtrace_filter = Minitest::BacktraceFilter.new

0 commit comments

Comments
 (0)