1
require 'cucumber/filters/activate_steps'
2
require 'cucumber/core/gherkin/writer'
3
require 'cucumber/core'
5
describe Cucumber::Filters::ActivateSteps do
6
include Cucumber::Core::Gherkin::Writer
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 }
14
context "a scenario with a single step" do
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'
29
compile [doc], receiver, [Cucumber::Filters::ActivateSteps.new(step_definitions)]
33
context "a scenario outline" do
38
step 'a <status> step'
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'
53
compile [doc], receiver, [Cucumber::Filters::ActivateSteps.new(step_definitions)]