Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange logging behaviour with rspec output capture #14

Open
sebbASF opened this issue Jul 13, 2020 · 0 comments
Open

Strange logging behaviour with rspec output capture #14

sebbASF opened this issue Jul 13, 2020 · 0 comments

Comments

@sebbASF
Copy link
Collaborator

sebbASF commented Jul 13, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant