Module: Tst
- Defined in:
- lib/tst.rb,
lib/tst/reporters/plain.rb,
lib/tst/reporters/pretty.rb
Defined Under Namespace
Modules: Assertions, Reporters Classes: Failure, Result, Results, Runner
Constant Summary collapse
- VERSION =
"0.0.3"
- SUCCEEDED =
Set up some constants to represent test outcomes.
:success
- FAILED =
:failure
- RAISED =
:exception
Class Method Summary collapse
-
.default_options ⇒ Object
The default options for ‘run`.
-
.run(glob, options = {}) ⇒ Object
The main entry point.
Class Method Details
.default_options ⇒ Object
The default options for ‘run`.
138 139 140 |
# File 'lib/tst.rb', line 138 def self. { :reporter => Reporters::Plain.new, :load_paths => [] } end |
.run(glob, options = {}) ⇒ Object
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)
128 129 130 131 132 133 134 135 |
# File 'lib/tst.rb', line 128 def self.run(glob, ={}) = .merge() $:.unshift(*[:load_paths]) results = Results.new reporter = [:reporter] Dir[glob].each { |file| Runner.new(file, reporter, results) } reporter.summarize(results) end |