spec/mixlib/log_spec.rb in mixlib-log-2.0.0 vs spec/mixlib/log_spec.rb in mixlib-log-2.0.1
- old
+ new
@@ -198,6 +198,25 @@
opened_files_count_after += 1 unless f.closed?
end
expect(opened_files_count_after).to eq(opened_files_count_before + 1)
end
+ it "should return nil from its logging methods" do
+ expect(Logger).to receive(:new).with(STDOUT) { double("a-quiet-logger").as_null_object }
+ Logit.init
+
+ aggregate_failures "returns nil from logging method" do
+ expect(Logit.trace("hello")).to be_nil
+ expect(Logit.debug("hello")).to be_nil
+ expect(Logit.info("hello")).to be_nil
+ expect(Logit.warn("hello")).to be_nil
+ expect(Logit.error("hello")).to be_nil
+ expect(Logit.fatal("hello")).to be_nil
+ end
+ end
+
+ it "should set metadata correctly" do
+ Logit.metadata = { test: "data" }
+ expect(Logit.metadata).to eql({ test: "data" })
+ end
+
end