~ubuntu-branches/ubuntu/wily/cucumber/wily-proposed

« back to all changes in this revision

Viewing changes to spec/cucumber/filters/tag_limits/test_case_index_spec.rb

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier, Antonio Terceiro, Cédric Boutillier
  • Date: 2015-06-20 16:52:32 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20150620165232-hznc8mxma08er27p
Tags: 2.0.0-1
[ Antonio Terceiro ]
* debian/cucumber.pod: fix typo in manpage (Closes: #767215)

[ Cédric Boutillier ]
* Imported Upstream version 2.0.0
* rename the file in debian/missing-source to remove -min suffix, and make
  lintian happy
* reproducibility: use last changelog date to build the manpage
* update 0004-Update_default_binary_path.patch
* drop 0001-Remove-rubygems-bundler-stuff-from-spec_helper.patch, not needed
  anymore
* build-depend on pry
* depend on ruby-cucumber-core

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require "cucumber/filters/tag_limits"
 
2
 
 
3
describe Cucumber::Filters::TagLimits::TestCaseIndex do
 
4
  subject(:index) { Cucumber::Filters::TagLimits::TestCaseIndex.new }
 
5
 
 
6
  let(:test_cases) do
 
7
    [
 
8
      double(:test_case, tags: [tag_one], location: a_location_of_tag_one),
 
9
      double(:test_case, tags: [tag_one, tag_two], location: a_location_of_tag_one_and_tag_two)
 
10
    ]
 
11
  end
 
12
 
 
13
  let(:tag_one) { double(:tag_one, name: "@one") }
 
14
  let(:tag_two) { double(:tag_two, name: "@two") }
 
15
 
 
16
  let(:a_location_of_tag_one) { double(:a_location_of_tag_one) }
 
17
  let(:a_location_of_tag_one_and_tag_two) { double(:a_location_of_tag_one_and_tag_two) }
 
18
 
 
19
  before do
 
20
    test_cases.map do |test_case|
 
21
      index.add(test_case)
 
22
    end
 
23
  end
 
24
 
 
25
  describe "#count_by_tag_name" do
 
26
    it "returns the number of test cases with the tag" do
 
27
      expect(index.count_by_tag_name("@one")).to eq(2)
 
28
      expect(index.count_by_tag_name("@two")).to eq(1)
 
29
    end
 
30
  end
 
31
 
 
32
  describe "#locations_by_tag_name" do
 
33
    it "returns the locations of test cases with the tag" do
 
34
      expect(index.locations_of_tag_name("@one")).to eq([a_location_of_tag_one, a_location_of_tag_one_and_tag_two])
 
35
      expect(index.locations_of_tag_name("@two")).to eq([a_location_of_tag_one_and_tag_two])
 
36
    end
 
37
  end
 
38
end