Skip to content

Strange logging behaviour with rspec output capture #14

@sebbASF

Description

@sebbASF

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions