Commit db843b9
Changed files (2)
lib
nasty
spec
unit
lib/nasty/log.rb
@@ -13,6 +13,10 @@ module Nasty
end
@@log_factory.create_for(target)
end
+
+ def unbind
+ remove_class_variable(:@@log_factory)
+ end
end
end
spec/unit/log_spec.rb
@@ -24,6 +24,10 @@ module Nasty
Log.for(self).debug("hi there")
end
+ after :each do
+ Log.unbind
+ end
+
it "should log to the bound logger" do
logger.should have_received(:debug).with("hi there")
end