wunderbar
wunderbar copied to clipboard
Strange logging behaviour with rspec output capture
There is some interaction between rspec output capture and rspec testing, for example the following test fails:
require 'wunderbar' describe "bug" do it "test1" do Wunderbar.info "test1" # disable this expect { # Wunderbar.logger = nil # or enable this Wunderbar.warn "test1" }.to output("_WARN test1\n").to_stderr end end
It succeeds if the info log is disabled or the logger is set to nil.
The workround is as above - reset the logger at the start of any expect block.