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

« back to all changes in this revision

Viewing changes to spec/cucumber/filters/activate_steps_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/activate_steps'
 
2
require 'cucumber/core/gherkin/writer'
 
3
require 'cucumber/core'
 
4
 
 
5
describe Cucumber::Filters::ActivateSteps do
 
6
  include Cucumber::Core::Gherkin::Writer
 
7
  include Cucumber::Core
 
8
 
 
9
  let(:step_definitions) { double(find_match: step_match) }
 
10
  let(:step_match) { double(activate: activated_test_step) }
 
11
  let(:activated_test_step) { double }
 
12
  let(:receiver) { double.as_null_object }
 
13
 
 
14
  context "a scenario with a single step" do
 
15
    let(:doc) do
 
16
      gherkin do
 
17
        feature do
 
18
          scenario do
 
19
            step 'a passing step'
 
20
          end
 
21
        end
 
22
      end
 
23
    end
 
24
 
 
25
    it "activates each step" do
 
26
      expect(step_match).to receive(:activate) do |test_step|
 
27
        expect(test_step.name).to eq 'a passing step'
 
28
      end
 
29
      compile [doc], receiver, [Cucumber::Filters::ActivateSteps.new(step_definitions)]
 
30
    end
 
31
  end
 
32
 
 
33
  context "a scenario outline" do
 
34
    let(:doc) do
 
35
      gherkin do
 
36
        feature do
 
37
          scenario_outline do
 
38
            step 'a <status> step'
 
39
 
 
40
            examples do
 
41
              row 'status'
 
42
              row 'passing'
 
43
            end
 
44
          end
 
45
        end
 
46
      end
 
47
    end
 
48
 
 
49
    it "activates each step" do
 
50
      expect(step_match).to receive(:activate) do |test_step|
 
51
        expect(test_step.name).to eq 'a passing step'
 
52
      end
 
53
      compile [doc], receiver, [Cucumber::Filters::ActivateSteps.new(step_definitions)]
 
54
    end
 
55
  end
 
56
 
 
57
end