Sha256: d39021baa97f273c0fa00ae2ac941f29a08ab061342cf19c91bd5497ef4cbcef
Contents?: true
Size: 1.41 KB
Versions: 3
Compression:
Stored size: 1.41 KB
Contents
require 'lucid/ast/names' module Lucid module AST class Examples #:nodoc: include Names include HasLocation attr_writer :outline_table attr_reader :comment, :keyword, :outline_table def initialize(location, comment, keyword, title, description, outline_table) @location, @comment, @keyword, @title, @description, @outline_table = location, comment, keyword, title, description, outline_table raise ArgumentError unless @location.is_a?(Location) raise ArgumentError unless @comment.is_a?(Comment) end attr_reader :gherkin_statement def gherkin_statement(statement=nil) @gherkin_statement ||= statement end def accept(visitor) return if Lucid.wants_to_quit visitor.visit_examples(self) do comment.accept(visitor) visitor.visit_examples_name(keyword, name) outline_table.accept(visitor) end end def skip_invoke! @outline_table.skip_invoke! end def each_example_row(&proc) @outline_table.cells_rows[1..-1].each(&proc) end def failed? @outline_table.cells_rows[1..-1].select{|row| row.failed?}.any? end def to_sexp sexp = [:examples, @keyword, name] comment = comment.to_sexp sexp += [comment] if comment sexp += [@outline_table.to_sexp] sexp end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lucid-0.0.9 | lib/lucid/ast/examples.rb |
lucid-0.0.8 | lib/lucid/ast/examples.rb |
lucid-0.0.7 | lib/lucid/ast/examples.rb |