wunderbar icon indicating copy to clipboard operation
wunderbar copied to clipboard

Strange logging behaviour with rspec output capture

Open sebbASF opened this issue 5 years ago • 0 comments

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.

sebbASF avatar Jul 13 '20 23:07 sebbASF