Skip to content

Commit

Permalink
Fail fast if neither Test::Unit nor MiniTest is loaded. Fixes freeran…
Browse files Browse the repository at this point in the history
  • Loading branch information
floehopper committed Jul 4, 2012
1 parent 41a8ddf commit c8eba68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mocha.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'mocha/version'
require 'mocha/integration'
require 'mocha_standalone'
require 'mocha/configuration'
require 'mocha/integration'
6 changes: 6 additions & 0 deletions lib/mocha/integration.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'mocha/options'

module Mocha

module Integration
Expand Down Expand Up @@ -33,6 +35,10 @@ def test_unit_testcase_inherits_from_miniunit_testcase?

end

unless Mocha::Integration.monkey_patches.any? || $mocha_options["skip_integration"]
raise "Test::Unit or MiniTest must be loaded *before* Mocha (use MOCHA_OPTIONS=skip_integration if you know what you are doing)."
end

Mocha::Integration.monkey_patches.each do |patch|
require patch
end

0 comments on commit c8eba68

Please sign in to comment.