lib/statsample/analysis/suitereportbuilder.rb in statsample-1.0.1 vs lib/statsample/analysis/suitereportbuilder.rb in statsample-1.1.0
- old
+ new
@@ -1,12 +1,15 @@
module Statsample
module Analysis
class SuiteReportBuilder < Suite
attr_accessor :rb
- def initialize(name,&block)
- super(name,&block)
- @rb=ReportBuilder.new(:name=>name)
+ def initialize(opts=Hash.new,&block)
+ if !opts.is_a? Hash
+ opts={:name=>opts}
+ end
+ super(opts,&block)
+ @rb=opts[:rb] || ReportBuilder.new(:name=>name)
end
def generate(filename)
run if @block
@rb.save(filename)
end
@@ -14,9 +17,12 @@
run if @block
@rb.to_text
end
def summary(o)
@rb.add(o)
+ end
+ def desc(d)
+ @rb.add(d)
end
def echo(*args)
args.each do |a|
@rb.add(a)
end