spec/timber/logger_spec.rb in timber-1.1.7 vs spec/timber/logger_spec.rb in timber-1.1.8
- old
+ new
@@ -115,6 +115,21 @@
it "should use the PassThroughFormatter" do
expect(logger.formatter).to be_kind_of(Timber::Logger::PassThroughFormatter)
end
end
end
+
+ describe "#formatter=" do
+ let(:io) { StringIO.new }
+ let(:logger) { Timber::Logger.new(io) }
+
+ it "should not allow non Timber::Logger::Formatter formatters" do
+ logger.formatter = ::Logger::Formatter.new
+ expect(logger.formatter).to be_kind_of(::Timber::Logger::HybridFormatter)
+ end
+
+ it "should allow Timber::Logger::Formatter formatters" do
+ logger.formatter = ::Timber::Logger::JSONFormatter.new
+ expect(logger.formatter).to be_kind_of(::Timber::Logger::JSONFormatter)
+ end
+ end
end
\ No newline at end of file