Class: Uttk::Strategies::RUnit
- Includes:
- Concrete
- Defined in:
- lib/uttk/strategies/RUnit.rb
Overview
Description
This strategy is wrapper around a Ruby unit test suite based on the test/unit library. Using RUnit you avoid the Ruby ‘require’ problem and you use all the power of the Uttk’s Suite and/or Pool.
How it works ?
RUnit works by invoking Ruby on the specified file and then by parsing the output in order to inject it into the Uttk’s log stream. To do that, you must use a specific TestRunner based on YAML. This TestRunner produces a YAML output readable by a human and the strategy.
Examples
You need to first write your unit test suite using the test/unit package and the YAML TestRunner. Then, you write a few line in the input Uttk file to incorporate the unit test in the Uttk’s suite.
The unit test suite file: foo_test.rb
require 'foo'
class FooTest < Test::Unit::TestCase
def test_1
assert(true)
end
end
The YAML input file for Uttk
---
RUnit example test:
strategy: RUnit
input: !path my_unit_directory/foo_test.rb
One suite for all your unit test suite
If you find cumbersome to write for every unit test files a single RUnit strategy into the YAML input file of Uttk, there is another way that is used in test/unit-suite.yml.
Instance Attribute Summary
Attributes inherited from Strategy
Method Summary
Methods inherited from Strategy
#abort, #assert_cmd, #assign, #clean_instance_variables, #display_unexpected_exc, #display_unexpected_synflow_exc, #fail, #initialize, #initialize_flow_factory, #mk_system_runner, #name=, #pass, #raise_error, #reject, #run, #running?, #skip, #skip_if_cached, #skip_pass, #skip_wrt_rpath_and_rpath_exclude, #strategy, #strategy=, #symbols=, #symtbl, #symtbl=, #testify, #timeout=, to_form, #to_s, to_yaml_type, #wclass=
Constructor Details
This class inherits a constructor from Uttk::Strategies::Strategy