spec/loggability_spec.rb in loggability-0.3.0 vs spec/loggability_spec.rb in loggability-0.4.0
- old
+ new
@@ -24,10 +24,11 @@
it "is itself a log host for the global logger" do
described_class.logger.should be_a( Loggability::Logger )
described_class.log_hosts.should include( Loggability::GLOBAL_KEY => Loggability )
end
+
describe "version methods" do
it "returns a version string if asked" do
described_class.version_string.should =~ /\w+ [\d.]+/
end
@@ -80,9 +81,20 @@
@class.log_to( :testing )
subclass = Class.new( @class )
subclass.log.logger.should be( origin.logger )
Loggability[ subclass ].should be( origin.logger )
+ end
+
+ it "wraps Logger instances assigned as its logger in a Loggability::Logger" do
+ @class.log_as( :testing )
+
+ logger = ::Logger.new( $stderr )
+
+ @class.logger = logger
+ @class.logger.should be_a( Loggability::Logger )
+
+ @class.log.debug "This shouldn't raise."
end
end