Permalink
Browse files

Add means of disabling autorun.

  • Loading branch information...
1 parent e76da65 commit 86aa0ccbfc638ec63050b29ee538ff85becd9039 @dchelimsky dchelimsky committed Jul 7, 2010
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/rspec/core/runner.rb
View
@@ -4,16 +4,20 @@ module RSpec
module Core
class Runner
- def self.installed_at_exit?
- @installed_at_exit ||= false
- end
-
def self.autorun
- return if installed_at_exit? || running_in_drb?
+ return if autorun_disabled? || installed_at_exit? || running_in_drb?
@installed_at_exit = true
at_exit { run(ARGV, $stderr, $stdout) ? exit(0) : exit(1) }
end
+ def self.autorun_disabled?
+ !!ENV['DISABLE_RSPEC_AUTORUN']
+ end
+
+ def self.installed_at_exit?
+ @installed_at_exit ||= false
+ end
+
def self.running_in_drb?
(DRb.current_server rescue false) &&
!!((DRb.current_server.uri) =~ /druby\:\/\/127.0.0.1\:/)

0 comments on commit 86aa0cc

Please sign in to comment.