Permalink
Browse files

RSpec.reset reinits configuration and world

- Fixes #621
  • Loading branch information...
1 parent 95bf11b commit b1dfc61404afac650aab9aedfbb57886f53a22c4 @dchelimsky dchelimsky committed May 18, 2012
Showing with 5 additions and 6 deletions.
  1. +2 −2 lib/rspec/core.rb
  2. +3 −4 spec/rspec/core/runner_spec.rb
View
@@ -66,8 +66,8 @@ def self.world
# Used internally to ensure examples get reloaded between multiple runs in
# the same process.
def self.reset
- world.reset
- configuration.reset
+ @world = nil
+ @configuration = nil
end
# Returns the global [Configuration](RSpec/Core/Configuration) object. While you
@@ -25,10 +25,9 @@ module RSpec::Core
let(:err) { StringIO.new }
let(:out) { StringIO.new }
- it "resets world and configuration" do
- RSpec.configuration.stub(:files_to_run) { [] }
- RSpec.configuration.should_receive(:reset)
- RSpec.world.should_receive(:reset)
+ it "tells RSpec to reset" do
+ RSpec.configuration.stub(:files_to_run => [])
+ RSpec.should_receive(:reset)
RSpec::Core::Runner.run([], err, out)
end

0 comments on commit b1dfc61

Please sign in to comment.