# Author:: Nicolas Pouillard . # Copyright:: Copyright (c) 2004, 2005 TTK team. All rights reserved. # License:: LGPL # $Id: Suite.rb 585 2005-04-30 01:21:03Z ertai $ module TTK module Strategies # An ordered collection of tests which can be #run. # # A the Suite class has two goals: # - group a set of Strategy in a single object which is a Strategy. # - factor some attributes which are identical in each tests of the # the suite. # # == Example # require 'ttk' # include TTK # # symtbl = TTK::SymTbl.new # symtbl[:loader] = Loaders::Yaml.new # aSuite = Strategies::Suite.new({ # :name => 'A set of tests', # :symtbl => symtbl, # :wclass => Weights::WFloat, # :attributes => { # :strategy => Strategies::Cmd, # :exit => 0 # }, # :contents => OHash[ # "I'm suppose to pass 1", { :command => "true" }, # "I'm suppose to fail 2", { :command => "false", :weight => -1 }, # "I'm suppose to pass 3", { :command => "false", # :exit => 1 } # ] # }) # aSuite.run(Logger.new(Dumpers::Yaml.new(STDOUT))) # # aSuite = Strategies::Suite.new # aSuite.name = 'A set of tests' # aSuite.symtbl = symtbl # aSuite.wclass = Weights::WFloat # aSuite.strategyclass = Strategies::Cmd # aSuite.exit = 0 # a sugar when its unambiguous. # t1 = aSuite.create # t1.name = "I'm suppose to pass 4" # t1.command = "true" # aSuite.create({ :name => "I'm suppose to fail 5", # :command => "false", # :weight => -1 }) # io = Tempfile.new('ttk-example') # io << << EOF # --- # name: I'm suppose to pass 6 # command: false # exit: 1 # EOF # io.rewind # aSuite.create(io) # aSuite.run(Logger.new(Dumpers::Yaml.new(STDOUT))) class Suite < Collection include Concrete include Ordered end # class Suite end # module Strategies end # module TTK