Sha256: f8e0f3e364ef741e6d8378a561f604cc645243c19168c8c711c0694c43c4cbf0

Contents?: true

Size: 1.24 KB

Versions: 21

Compression:

Stored size: 1.24 KB

Contents

require "cucumber/filters/tag_limits"

describe Cucumber::Filters::TagLimits::TestCaseIndex do
  subject(:index) { Cucumber::Filters::TagLimits::TestCaseIndex.new }

  let(:test_cases) do
    [
      double(:test_case, tags: [tag_one], location: a_location_of_tag_one),
      double(:test_case, tags: [tag_one, tag_two], location: a_location_of_tag_one_and_tag_two)
    ]
  end

  let(:tag_one) { double(:tag_one, name: "@one") }
  let(:tag_two) { double(:tag_two, name: "@two") }

  let(:a_location_of_tag_one) { double(:a_location_of_tag_one) }
  let(:a_location_of_tag_one_and_tag_two) { double(:a_location_of_tag_one_and_tag_two) }

  before do
    test_cases.map do |test_case|
      index.add(test_case)
    end
  end

  describe "#count_by_tag_name" do
    it "returns the number of test cases with the tag" do
      expect(index.count_by_tag_name("@one")).to eq(2)
      expect(index.count_by_tag_name("@two")).to eq(1)
    end
  end

  describe "#locations_by_tag_name" do
    it "returns the locations of test cases with the tag" do
      expect(index.locations_of_tag_name("@one")).to eq([a_location_of_tag_one, a_location_of_tag_one_and_tag_two])
      expect(index.locations_of_tag_name("@two")).to eq([a_location_of_tag_one_and_tag_two])
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
cucumber-2.99.0 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
mobiusloop-0.1.5 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.4.0 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
mobiusloop-0.1.3 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
mobiusloop-0.1.2 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.3.3 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.3.2 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.3.1 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.3.0 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.2.0 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.1.0 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.2 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.1 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.0 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.0.rc.5 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.0.rc.4 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.0.rc.3 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.0.rc.2 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.0.rc.1 spec/cucumber/filters/tag_limits/test_case_index_spec.rb
cucumber-2.0.0.beta.5 spec/cucumber/filters/tag_limits/test_case_index_spec.rb