File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 3
3
require "dotenv/rails"
4
4
5
5
describe Dotenv ::Rails do
6
- let ( :log_io ) { StringIO . new }
6
+ let ( :log_output ) { StringIO . new }
7
7
let ( :application ) do
8
- log_io = self . log_io
8
+ log_output = self . log_output
9
9
Class . new ( Rails ::Application ) do
10
10
config . load_defaults Rails ::VERSION ::STRING . to_f
11
11
config . eager_load = false
12
- config . logger = ActiveSupport ::Logger . new ( log_io )
12
+ config . logger = ActiveSupport ::Logger . new ( log_output )
13
13
config . root = fixture_path
14
14
15
15
# Remove method fails since app is reloaded for each test
201
201
end
202
202
203
203
describe "logger" do
204
- it "defaults to ReplayLogger" do
205
- expect ( Dotenv ::Rails . logger ) . to be_a ( Dotenv ::ReplayLogger )
206
- application . initialize!
207
- expect ( Dotenv ::Rails . logger ) . to be_a ( ActiveSupport ::BroadcastLogger )
208
- end
209
-
210
204
it "replays to Rails.logger" do
205
+ expect ( Dotenv ::Rails . logger ) . to be_a ( Dotenv ::ReplayLogger )
211
206
Dotenv ::Rails . logger . debug ( "test" )
207
+
212
208
application . initialize!
213
- expect ( log_io . string ) . to include ( "test" )
209
+
210
+ expect ( Dotenv ::Rails . logger ) . not_to be_a ( Dotenv ::ReplayLogger )
211
+ expect ( log_output . string ) . to include ( "test" )
214
212
end
215
213
end
216
214
end
You can’t perform that action at this time.
0 commit comments