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
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/gherkin-2.9.0/spec/gherkin/formatter/tag_count_formatter_spec.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/gherkin-2.3.3/spec/gherkin/formatter/tag_count_formatter_spec.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/spec/gherkin/formatter/tag_count_formatter_spec.rb
ftl-0.2.0 vendor/bundle/gems/gherkin-2.10.0/spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.10.0 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.10.0-x86-mswin32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.10.0-x86-mingw32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.10.0-java spec/gherkin/formatter/tag_count_formatter_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/spec/gherkin/formatter/tag_count_formatter_spec.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/spec/gherkin/formatter/tag_count_formatter_spec.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/spec/gherkin/formatter/tag_count_formatter_spec.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/spec/gherkin/formatter/tag_count_formatter_spec.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/gherkin-2.9.3/spec/gherkin/formatter/tag_count_formatter_spec.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/gherkin-2.9.0/spec/gherkin/formatter/tag_count_formatter_spec.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/gherkin-2.3.3/spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.9.3 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.9.3-x86-mswin32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.9.3-x86-mingw32 spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.9.3-java spec/gherkin/formatter/tag_count_formatter_spec.rb
gherkin-2.9.2 spec/gherkin/formatter/tag_count_formatter_spec.rb