Skip to content

Commit

Permalink
Unload previous examples before every test run
Browse files Browse the repository at this point in the history
  • Loading branch information
nilbus committed May 30, 2013
1 parent 74a7177 commit bf676e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/guard/jruby-rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def start
end

def run_on_changes(raw_paths)
unload_previous_examples
@reloaders.reload(raw_paths)

unless @custom_watchers.nil? or @custom_watchers.empty?
Expand Down Expand Up @@ -114,11 +113,6 @@ def set_up_reloaders(options)

reloaders
end

def unload_previous_examples
::RSpec.configuration.reset
::RSpec.world.reset
end
end
end

5 changes: 5 additions & 0 deletions lib/guard/jruby-rspec/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def run(paths, options = {})
# $stderr.reopen(orig_stderr)
# end
else
unload_previous_examples
orig_configuration = ::RSpec.configuration
Containment.new.protect do
::RSpec::Core::Runner.run(rspec_arguments(paths, @options))
Expand Down Expand Up @@ -82,6 +83,10 @@ def formatter_regex
@formatter_regex ||= /(?:^|\s)(?:-f\s*|--format(?:=|\s+))([\w:]+)/
end

def unload_previous_examples
::RSpec.configuration.reset
::RSpec.world.reset
end
end
end
end

0 comments on commit bf676e6

Please sign in to comment.