spec/nyanko/logger_spec.rb in nyanko-0.0.6 vs spec/nyanko/logger_spec.rb in nyanko-0.0.7

- old
+ new

@@ -38,27 +38,23 @@ [Nyanko] test.rb:10:in `method10' EOS end context "when Config.enable_logger is true" do - around do |example| - origin, Config.enable_logger = Config.enable_logger, true - example.run - Config.enable_logger = origin + before do + Config.enable_logger = true end context "when given Exception" do it "parses and logs it" do described_class.debug(exception) log.should == lines.join("\n") end context "when Config.backtrace_limit is configured" do - around do |example| - origin, Config.backtrace_limit = Config.backtrace_limit, 5 - example.run - Config.backtrace_limit = origin + before do + Config.backtrace_limit = 5 end it "prints backtrace up to configured depth" do described_class.debug(exception) log.should == lines[0..5].join("\n") @@ -73,13 +69,11 @@ end end end context "when Config.enable_logger is false" do - around do |example| - origin, Config.enable_logger = Config.enable_logger, false - example.run - Config.enable_logger = origin + before do + Config.enable_logger = false end it "logs nothing" do described_class.debug("test") log.should == ""