Sha256: c0462bb51f14ab6c0c2b21848b46be08d2f8fd4a7add7acde87ae585a0dc1748

Contents?: true

Size: 1.06 KB

Versions: 406

Compression:

Stored size: 1.06 KB

Contents

# encoding: utf-8
require 'spec_helper'
require 'gherkin/parser/parser'
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

406 entries across 399 versions & 11 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/gherkin-2.12.2/spec/gherkin/formatter/tag_count_formatter_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/gherkin-2.12.2/spec/gherkin/formatter/tag_count_formatter_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/gherkin-2.12.2/spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.2 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.2-x86-mswin32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.2-x86-mingw32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.2-java spec/gherkin/formatter/tag_count_formatter_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/gherkin-2.11.1/spec/gherkin/formatter/tag_count_formatter_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/gherkin-2.11.1/spec/gherkin/formatter/tag_count_formatter_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/gherkin-2.11.1/spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.1 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.1-x86-mswin32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.1-x86-mingw32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.1-java spec/gherkin/formatter/tag_count_formatter_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/gherkin-2.11.6/spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.0 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.0-x86-mingw32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.0-x86-mswin32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.12.0-java spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.11.8 spec/gherkin/formatter/tag_count_formatter_spec.rb