Permalink
Browse files

bin/autotest masks Dir[] warnings from rubygems because they are dumb.

   bin/autotest now exits with a nice message if style plugin isn't found.
   autotest.rb now builds command separator with '&' on windoze. argh.
   Fixed autotest's "vendor/plugins/*/lib" glob.

[git-p4: depot-paths = "//src/ZenTest/dev/": change = 3208]
  • Loading branch information...
1 parent e4b1eae commit 94e15004141013a373b372269a1bd82495decf40 @zenspider zenspider committed May 24, 2007
Showing with 24 additions and 4 deletions.
  1. +1 −1 Rakefile
  2. +17 −1 bin/autotest
  3. +6 −2 lib/autotest.rb
View
@@ -18,7 +18,7 @@ Hoe.new("ZenTest", ZenTest::VERSION) do |p|
end
task :autotest do
- ruby "-Ilib ./bin/autotest"
+ ruby "-Ilib -w ./bin/autotest"
end
task :update do
View
@@ -20,13 +20,29 @@ if $h or $help then
exit 1
end
+class Dir
+ class << self
+ alias :old_index :[]
+ def [](*args)
+ $-w, old_warn = false, $-w
+ old_index(*args)
+ ensure
+ $-w = old_warn
+ end
+ end
+end
+
require 'autotest'
style = Autotest.autodiscover
target = Autotest
unless style.empty? then
mod = "autotest/#{style.join("_")}"
puts "loading #{mod}"
- require mod
+ begin
+ require mod
+ rescue LoadError
+ abort "Autotest style #{mod} doesn't seem to exist. Aborting."
+ end
target = Autotest.const_get(style.map {|s| s.capitalize}.join)
end
target.run
View
@@ -58,6 +58,10 @@
class Autotest
HOOKS = Hash.new { |h,k| h[k] = [] }
+ unless defined? WINDOZE then
+ WINDOZE = /win32/ =~ RUBY_PLATFORM
+ SEP = WINDOZE ? '&' : ';'
+ end
@@discoveries = []
@@ -97,7 +101,7 @@ def self.add_discovery &proc
def self.autodiscover
style = []
- $:.push(*Dir["vendor/plugin/*/lib"])
+ $:.push(*Dir["vendor/plugins/*/lib"])
paths = $:.dup
begin
@@ -349,7 +353,7 @@ def make_test_cmd files_to_test
cmds << "#{ruby} -I#{@libs} #{klass} -n \"/^(#{Regexp.union(*methods).source})$/\" | #{unit_diff}"
end
- return cmds.join('; ')
+ return cmds.join("#{SEP} ")
end
# Rerun the tests from cold (reset state)

0 comments on commit 94e1500

Please sign in to comment.