class ParallelTests::Gherkin::Listener
Attributes
Public Class Methods
Source
# File lib/parallel_tests/gherkin/listener.rb, line 9 def initialize @steps = [] @uris = [] @collect = {} @feature, @ignore_tag_pattern = nil reset_counters! end
Public Instance Methods
Source
# File lib/parallel_tests/gherkin/listener.rb, line 21 def background(*) @background = 1 end
Source
# File lib/parallel_tests/gherkin/listener.rb, line 59 def eof(*) @collect[@uri] += (@background_steps * @scenarios) reset_counters! end
Source
# File lib/parallel_tests/gherkin/listener.rb, line 55 def examples(examples) @collect[@uri] += (@outline_steps * examples.rows.size) unless examples.rows.empty? end
@param [Gherkin::Formatter::Model::Examples] examples
Source
# File lib/parallel_tests/gherkin/listener.rb, line 17 def feature(feature) @feature = feature end
Source
# File lib/parallel_tests/gherkin/listener.rb, line 70 def method_missing(*); end
ignore lots of other possible callbacks …
Source
# File lib/parallel_tests/gherkin/listener.rb, line 64 def reset_counters! @outline = @outline_steps = @background = @background_steps = @scenarios = 0 @ignoring = nil end
Source
# File lib/parallel_tests/gherkin/listener.rb, line 25 def scenario(scenario) @outline = @background = 0 return if should_ignore(scenario) @scenarios += 1 end
Source
# File lib/parallel_tests/gherkin/listener.rb, line 31 def scenario_outline(outline) return if should_ignore(outline) @outline = 1 end
Source
# File lib/parallel_tests/gherkin/listener.rb, line 36 def step(*) return if @ignoring if @background == 1 @background_steps += 1 elsif @outline > 0 @outline_steps += 1 else @collect[@uri] += 1 end end
Source
# File lib/parallel_tests/gherkin/listener.rb, line 47 def uri(path) @uri = path @collect[@uri] = 0 end
Private Instance Methods
Source
# File lib/parallel_tests/gherkin/listener.rb, line 80 def should_ignore(scenario) @ignoring = @ignore_tag_pattern && all_tags(scenario).find { |tag| @ignore_tag_pattern === tag.name } end
Set @ignoring if we should ignore this scenario/outline based on its tags