Test plugin for hoe.
| audit | Run ZenTest against the package. |
| default | Run the default task(s). |
| multi | Run the test suite using multiruby. |
| test | Run the test suite. |
| test_deps | Show which test files fail when run alone. |
Configuration for the supported test frameworks for test task.
Used to add flags to test_unit (e.g., -n test_borked).
eg FILTER=”-n test_blah“
Define tasks for plugin.
# File lib/hoe/test.rb, line 62
62: def define_test_tasks
63: default_tasks = []
64:
65: if File.directory? "test" then
66: desc 'Run the test suite. Use FILTER or TESTOPTS to add flags/args.'
67: task :test do
68: ruby make_test_cmd
69: end
70:
71: desc 'Run the test suite using multiruby.'
72: task :multi do
73: ruby make_test_cmd(:multi)
74: end
75:
76: desc 'Show which test files fail when run alone.'
77: task :test_deps do
78: tests = Dir["test/**/test_*.rb"] + Dir["test/**/*_test.rb"]
79:
80: paths = ['bin', 'lib', 'test'].join(File::PATH_SEPARATOR)
81: null_dev = Hoe::WINDOZE ? '> NUL 2>&1' : '&> /dev/null'
82:
83: tests.each do |test|
84: if not system "ruby -I#{paths} #{test} #{null_dev}" then
85: puts "Dependency Issues: #{test}"
86: end
87: end
88: end
89:
90: default_tasks << :test
91: end
92:
93: if File.directory? "spec" then
94: begin
95: require 'spec/rake/spectask'
96:
97: desc "Run all specifications"
98: Spec::Rake::SpecTask.new(:spec) do |t|
99: t.libs = self.rspec_dirs
100: t.spec_opts = self.rspec_options
101: end
102: rescue LoadError
103: # do nothing
104: end
105: default_tasks << :spec
106: end
107:
108: desc 'Run the default task(s).'
109: task :default => default_tasks
110:
111: desc 'Run ZenTest against the package.'
112: task :audit do
113: libs = %(lib test ext).join(File::PATH_SEPARATOR)
114: sh "zentest -I=#{libs} #{spec.files.grep(/^(lib|test)/).join(' ')}"
115: end
116: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.