Skip to content

Commit

Permalink
+ Improved warning message about minitest/autorun to address 1.9's mi…
Browse files Browse the repository at this point in the history
…nitest/autorun.

[git-p4: depot-paths = "//src/minitest/dev/": change = 8728]
  • Loading branch information
zenspider committed Jun 24, 2013
1 parent f771b23 commit bc1bcd2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/minitest/unit.rb
Expand Up @@ -4,8 +4,12 @@
# all of this crap is just to avoid circular requires and is only
# needed if a user requires "minitest/unit" directly instead of
# "minitest/autorun", so we also warn
from = caller.join("\n ")
warn "Warning: you should require 'minitest/autorun' instead.\nFrom #{from}"

from = caller.reject { |s| s =~ /rubygems/ }.join("\n ")
warn "Warning: you should require 'minitest/autorun' instead."
warn %(Warning: or add 'gem "minitest"' before 'require "minitest/autorun"')
warn "From:\n #{from}"

module Minitest; end
MiniTest = Minitest # prevents minitest.rb from requiring back to us
require "minitest"
Expand Down

0 comments on commit bc1bcd2

Please sign in to comment.