-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ActiveModelSerializers.logger with default null device
- Loading branch information
Showing
3 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'test_helper' | ||
|
||
class ActiveModelSerializers::LoggerTest < Minitest::Test | ||
|
||
def test_logger_is_set_to_action_controller_logger_when_initializer_runs | ||
assert_equal ActiveModelSerializers.logger, ActionController::Base.logger | ||
end | ||
|
||
def test_logger_can_be_set | ||
original_logger = ActiveModelSerializers.logger | ||
logger = Logger.new(STDOUT) | ||
|
||
ActiveModelSerializers.logger = logger | ||
|
||
assert_equal ActiveModelSerializers.logger, logger | ||
ensure | ||
ActiveModelSerializers.logger = original_logger | ||
end | ||
end |