summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-12-27 10:19:20 -0700
committermo khan <mo@mokhan.ca>2013-12-27 10:19:20 -0700
commitdb843b9d35d0e7f13ee24e6709d01196a17dec3c (patch)
treefcbe19e2423dd06c666523cd44001fc436739cc1
parent5acc5665f0ae4be8496061de524d3c173aefb071 (diff)
undefine logger after each spec.
-rw-r--r--lib/nasty/log.rb4
-rw-r--r--spec/unit/log_spec.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/nasty/log.rb b/lib/nasty/log.rb
index 417d5dd..4d5fced 100644
--- a/lib/nasty/log.rb
+++ b/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
diff --git a/spec/unit/log_spec.rb b/spec/unit/log_spec.rb
index c86014a..0ac6e1d 100644
--- a/spec/unit/log_spec.rb
+++ b/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