Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
124 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20200613113000: Remove $CELLULOID_DEBUG global variable. Fallback to [Logger](https://ruby-doc.org/stdlib-2.2.0/libdoc/logger/rdoc/Logger.html) mechanisms. [Issue #742](https://github.com/celluloid/celluloid/issues/742) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
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
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,90 @@ | ||
RSpec.describe Celluloid::Internals::Logger do | ||
before do | ||
Celluloid.logger = Logger.new(STDERR) | ||
end | ||
|
||
describe "#debug" do | ||
subject { -> { described_class.debug("debug message") }} | ||
context "when logger is nil" do | ||
before do | ||
Celluloid.logger = nil | ||
end | ||
it { is_expected.not_to raise_error } | ||
end | ||
|
||
context "when logger is a Logger object" do | ||
it do | ||
expect(Celluloid.logger).to receive(:debug).once | ||
subject.call | ||
end | ||
|
||
context "logging level is DEBUG" do | ||
before do | ||
Celluloid.logger.level = Logger::DEBUG | ||
end | ||
it { is_expected.to output.to_stderr_from_any_process } | ||
end | ||
|
||
context "logging level is INFO" do | ||
before do | ||
Celluloid.logger.level = Logger::INFO | ||
end | ||
it { is_expected.not_to output.to_stderr_from_any_process } | ||
end | ||
end | ||
end | ||
|
||
describe "#info" do | ||
subject { described_class.info("info message") } | ||
context "when logger is nil" do | ||
before do | ||
Celluloid.logger = nil | ||
expect { subject }.not_to raise_error | ||
end | ||
it { subject } | ||
end | ||
|
||
context "when logger is a Logger object" do | ||
before do | ||
expect(Celluloid.logger).to receive(:info).once | ||
end | ||
it { subject } | ||
end | ||
end | ||
|
||
describe "#warn" do | ||
subject { described_class.warn("warn message") } | ||
context "when logger is nil" do | ||
before do | ||
Celluloid.logger = nil | ||
expect { subject }.not_to raise_error | ||
end | ||
it { subject } | ||
end | ||
|
||
context "when logger is a Logger object" do | ||
before do | ||
expect(Celluloid.logger).to receive(:warn).once | ||
end | ||
it { subject } | ||
end | ||
end | ||
|
||
describe "#error" do | ||
subject { described_class.error("error message") } | ||
context "when logger is nil" do | ||
before do | ||
Celluloid.logger = nil | ||
expect { subject }.not_to raise_error | ||
end | ||
it { subject } | ||
end | ||
|
||
context "when logger is a Logger object" do | ||
before do | ||
expect(Celluloid.logger).to receive(:error).once | ||
end | ||
it { subject } | ||
end | ||
end | ||
end |
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