module Tst
Constants
- FAILED
- RAISED
- Result
A little value object containing test result data
- SUCCEEDED
Set up some constants to represent test outcomes.
- VERSION
Public Class Methods
default_options()
click to toggle source
The default options for `run`.
# File lib/tst.rb, line 138 def self.default_options { :reporter => Reporters::Plain.new, :load_paths => [] } end
run(glob, options={})
click to toggle source
The main entry point.
glob - a String defining which test files to run.
Passed through to Dir[].
Accepted options:
:load_paths - an Array of directories to add to the load path. :reporter - a reporter instance (see 'lib/tst/reporters.rb' for docs on reporters)
# File lib/tst.rb, line 128 def self.run(glob, options={}) options = default_options.merge(options) $:.unshift(*options[:load_paths]) results = Results.new reporter = options[:reporter] Dir[glob].each { |file| Runner.new(file, reporter, results) } reporter.summarize(results) end