Class | TTK::Strategies::Composite |
In: |
lib/ttk/strategies/Composite.rb
|
Parent: | Strategy |
# File lib/ttk/strategies/Composite.rb, line 15 def initialize ( *a, &b ) @contents = [] @status_list = [] super end
# File lib/ttk/strategies/Composite.rb, line 28 def create ( anObject, &block ) res = @symtbl[:loader].load(anObject) do |aTest| initialize_test(aTest) block[aTest] if block_given? end @contents << res res end
# File lib/ttk/strategies/Composite.rb, line 22 def initialize_test ( aTest ) aTest.wclass = @wclass aTest.symtbl = new_symtbl end
# File lib/ttk/strategies/Composite.rb, line 78 def assertion compute_final_weight fail @final_weight, @fatal_failure if defined? @fatal_failure skip if @tmp_weight.start? pass if @final_weight.pass? fail @final_weight end
# File lib/ttk/strategies/Composite.rb, line 88 def epilogue compute_final_weight (@log.path_size - @composite_saved_path_size).times { @log.up } super end
Do some tasks after a test of the composite has been run.
# File lib/ttk/strategies/Composite.rb, line 110 def epilogue_test ( test, log ) if test.fatal and not test.status.pass? @fatal_failure = "Last test was fatal (#{test.name})" end end
# File lib/ttk/strategies/Composite.rb, line 49 def prologue begin super ensure @composite_saved_path_size = @log.path_size end # @contents.map! do |t| # t.testify # end end
Do some tasks before a test of the composite is run.
# File lib/ttk/strategies/Composite.rb, line 97 def prologue_test ( test, log ) end
# File lib/ttk/strategies/Composite.rb, line 126 def run_composite @log.new_node :contents, :seq do @contents.each do |t| run_test(t, @log) break if defined? @fatal_failure end end end
# File lib/ttk/strategies/Composite.rb, line 62 def run_impl skip if @contents.empty? run_composite() end
Do some tasks at the moment where a test of the composite is run.
# File lib/ttk/strategies/Composite.rb, line 103 def run_impl_test ( test, log ) test.run(log) end