Sha256: d42fec65d67df1ffd513fc1b1afd9fe8eb9d3feef810ded185fed82b805aad17

Contents?: true

Size: 1.18 KB

Versions: 21

Compression:

Stored size: 1.18 KB

Contents

require "cucumber/filters/gated_receiver"

describe Cucumber::Filters::GatedReceiver do
  subject(:gated_receiver) { Cucumber::Filters::GatedReceiver.new(receiver) }

  let(:receiver) { double(:receiver) }
  let(:test_cases){ [double(:test_case), double(:test_case)] }

  describe "#test_case" do
    it "does not immediately describe the test case to the receiver" do
      test_cases.each do |test_case|
        expect(test_case).to_not receive(:describe_to).with(receiver)
      end

      test_cases.each do |test_case|
        gated_receiver.test_case(test_case)
      end
    end
  end

  describe "#done" do
    before do
      test_cases.each do |test_case|
        gated_receiver.test_case(test_case)
      end

      test_cases.each do |test_case|
        allow(test_case).to receive(:describe_to).with(receiver)
      end

      allow(receiver).to receive(:done)
    end

    it "describes all test cases to the receiver" do
      test_cases.each do |test_case|
        expect(test_case).to receive(:describe_to).with(receiver)
      end

      gated_receiver.done
    end

    it "calls done on the receiver" do
      expect(receiver).to receive(:done)
      gated_receiver.done
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

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