Sha256: e461b71b58ee02eec58866f11102936cd4b6c9ea248efdde1cdb43249734aebc

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

# encoding: utf-8
require 'spec_helper'
require 'gherkin/i18n_lexer'
require 'gherkin/listener/formatter_listener'
require 'gherkin/formatter/tag_count_formatter'

module Gherkin
  module Formatter
    describe TagCountFormatter do
      it "should count tags" do
        tag_counts = {}
        dummy = Gherkin::SexpRecorder.new
        formatter = Gherkin::Formatter::TagCountFormatter.new(dummy, tag_counts)
        parser = Gherkin::Parser::Parser.new(formatter)

        f = File.new(File.dirname(__FILE__) + "/../fixtures/complex_with_tags.feature").read
        parser.parse(f, 'f.feature', 0)
        
        tag_counts.should == {
          "@hamster" => ["f.feature:58"],
          "@tag1"    => ["f.feature:18","f.feature:23","f.feature:39","f.feature:52","f.feature:58"],
          "@tag2"    => ["f.feature:18","f.feature:23","f.feature:39","f.feature:52","f.feature:58"],
          "@tag3"    => ["f.feature:18", "f.feature:23"],
          "@tag4"    => ["f.feature:18"],
          "@neat"    => ["f.feature:52"],
          "@more"    => ["f.feature:52", "f.feature:58"]
        }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gherkin-2.1.1 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.1-i386-mswin32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.1-i386-mingw32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.1-universal-dotnet spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.1-java spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.0-i386-mswin32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.0-i386-mingw32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.0 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.0-universal-dotnet spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.1.0-java spec/gherkin/formatter/tag_count_formatter_spec.rb