Class: CIAT::Test
- Inherits:
-
Object
- Object
- CIAT::Test
- Defined in:
- lib/ciat/test.rb
Instance Attribute Summary collapse
-
#processors ⇒ Object
readonly
Returns the value of attribute processors.
Instance Method Summary collapse
- #element(*names) ⇒ Object
- #element?(*names) ⇒ Boolean
- #elements ⇒ Object
- #filename ⇒ Object
- #grouping ⇒ Object
-
#initialize(test_file, processors, feedback) ⇒ Test
constructor
:nodoc:.
- #run ⇒ Object
-
#run_processors ⇒ Object
:nodoc:.
- #subresult(processor, light = CIAT::TrafficLight::UNSET) ⇒ Object
Constructor Details
#initialize(test_file, processors, feedback) ⇒ Test
:nodoc:
8 9 10 11 12 |
# File 'lib/ciat/test.rb', line 8 def initialize(test_file, processors, feedback) #:nodoc: @test_file = test_file @processors = processors @feedback = feedback end |
Instance Attribute Details
#processors ⇒ Object (readonly)
Returns the value of attribute processors.
6 7 8 |
# File 'lib/ciat/test.rb', line 6 def processors @processors end |
Instance Method Details
#element(*names) ⇒ Object
48 49 50 |
# File 'lib/ciat/test.rb', line 48 def element(*names) elements[names.compact.join("_").to_sym] end |
#element?(*names) ⇒ Boolean
52 53 54 |
# File 'lib/ciat/test.rb', line 52 def element?(*names) elements.has_key?(names.compact.join("_").to_sym) end |
#elements ⇒ Object
14 15 16 |
# File 'lib/ciat/test.rb', line 14 def elements @elements ||= @test_file.process end |
#filename ⇒ Object
18 19 20 |
# File 'lib/ciat/test.rb', line 18 def filename @test_file.filename(:ciat) end |
#grouping ⇒ Object
26 27 28 |
# File 'lib/ciat/test.rb', line 26 def grouping @test_file.grouping end |
#run ⇒ Object
22 23 24 |
# File 'lib/ciat/test.rb', line 22 def run CIAT::TestResult.new(self, run_processors) end |
#run_processors ⇒ Object
:nodoc:
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ciat/test.rb', line 30 def run_processors #:nodoc: light = CIAT::TrafficLight::GREEN processors.map do |processor| if light.green? light = processor.process(self) subresult(processor, light) else subresult(processor) end end end |