Skip to content

Loading…

Clear formatters between runs #435

Closed
wants to merge 3 commits into from

2 participants

@johnbintz

Clear the @formatters Array on a Configuration instance when resetting to clean up output when performing multiple RSpec runs within the same process. See issue #434 for more details.

@dchelimsky
RSpec member

Thanks for the pull request. Would you please add an example to the configuration spec that specifies that the array is empty after calling reset? Once you do that I'll be glad to merge.

@johnbintz

Spec added.

@dchelimsky dchelimsky added a commit that closed this pull request
@johnbintz johnbintz clear formatters between runs
- Closes #435.
371fc52
@dchelimsky dchelimsky closed this in 371fc52
@dchelimsky dchelimsky added a commit that referenced this pull request
@dchelimsky dchelimsky Clear formatters rather than creating new array object, and split exa…
…mple for config.reset

- #435
af6f886
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 6, 2011
  1. @johnbintz
Commits on Aug 7, 2011
  1. @johnbintz
  2. @johnbintz

    change quote type

    johnbintz committed
Showing with 9 additions and 0 deletions.
  1. +1 −0 lib/rspec/core/configuration.rb
  2. +8 −0 spec/rspec/core/configuration_spec.rb
View
1 lib/rspec/core/configuration.rb
@@ -66,6 +66,7 @@ def initialize
def reset
@reporter = nil
+ @formatters = []
end
# :call-seq:
View
8 spec/rspec/core/configuration_spec.rb
@@ -886,5 +886,13 @@ def metadata_hash(*args)
end
end
+ describe "#reset" do
+ it "resets the reporter and formatters" do
+ config.reporter
+ config.formatters.should_not be_empty
+ config.reset
+ config.formatters.should be_empty
+ end
+ end
end
end
Something went wrong with that request. Please try again.