lib/atp/flow.rb in atp-0.3.0 vs lib/atp/flow.rb in atp-0.3.1
- old
+ new
@@ -3,10 +3,11 @@
# with an abstract test program
class Flow
attr_reader :program, :name
# Returns the raw AST
attr_reader :raw
+ attr_accessor :id
def initialize(program, name = nil)
@program = program
@name = name
@raw = builder.flow
@@ -24,10 +25,13 @@
# Returns a processed/optimized AST, this is the one that should be
# used to build and represent the given test flow
def ast
ast = Processors::PreCleaner.new.process(raw)
+ # File.open("a1.txt", "w") { |f| f.write(ast) }
+ ast = Processors::FlowID.new.run(ast, id) if id
+ # File.open("a2.txt", "w") { |f| f.write(ast) }
Validators::DuplicateIDs.new(self).process(ast)
Validators::MissingIDs.new(self).process(ast)
ast = Processors::Condition.new.process(ast)
ast = Processors::Relationship.new.process(ast)
ast = Processors::PostCleaner.new.process(ast)
@@ -256,9 +260,10 @@
end
def extract_meta!(options)
builder.source_file = options.delete(:source_file) if options[:source_file]
builder.source_line_number = options.delete(:source_line_number) if options[:source_line_number]
+ builder.description = options.delete(:description) if options[:description]
end
# For testing
def raw=(ast)
@raw = ast