Sha256: 0afedffc4a21243f2e9ed97b97423d2ecea1ccc5ae25977b7abce066f05c5686

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

require "cucumber/runtime/tag_limits"

describe Cucumber::Runtime::TagLimits::TestCaseIndex do
  subject(:index) { Cucumber::Runtime::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

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-2.0.0.beta.3 spec/cucumber/runtime/tag_limits/test_case_index_spec.rb
cucumber-2.0.0.beta.2 spec/cucumber/runtime/tag_limits/test_case_index_spec.rb
cucumber-2.0.0.beta.1 spec/cucumber/runtime/tag_limits/test_case_index_spec.rb