Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Fix with_isolated_stderr so it does not leak. #68

Merged
merged 1 commit into from
May 23, 2014

Conversation

myronmarston
Copy link
Member

Without ensure, it leaves $stderr set to a different value.

Fixes rspec/rspec-core#1534.

So that rspec-core issue wasn't actually a problem with rspec-core; it was a problem with this line in an rspec-mocks test:

https://github.com/rspec/rspec-mocks/blob/83c1456d9e9bddcb624b00f636340a837f42e6b2/spec/rspec/mocks/argument_matchers_spec.rb#L209

...which used with_isolated_stderr, was wrapping a spot where an exception was raised, and as a result $stderr would remain silenced after that. That in turn cased the exception in the formatter not to be printed to the console like it normally would be.

/cc @JonRowe

Without ensure, it leaves $stderr set to a different value.

Fixes rspec/rspec-core#1534.
@cupakromer
Copy link
Member

LGTM

myronmarston added a commit that referenced this pull request May 23, 2014
Fix `with_isolated_stderr` so it does not leak.
@myronmarston myronmarston merged commit 6cd89ef into master May 23, 2014
@myronmarston myronmarston deleted the fix-with-isolated-stderr branch May 23, 2014 21:43
@JonRowe
Copy link
Member

JonRowe commented May 24, 2014

Makes sense, nice simple change too, possibly worth a bugfix mention on core somewhere?

@myronmarston
Copy link
Member Author

Nope. with_isolated_stderr isn't used by any of the lib code of any of our projects -- it's just a spec helper method that affected our specs. There's no way for a user to have been affected by this.

@JonRowe
Copy link
Member

JonRowe commented May 24, 2014

Oh for some reason I thought this was part of the stderr matcher, my bad :)

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

Successfully merging this pull request may close these issues.

Errors in formatter notification methods are silently ignored
3 participants