Sha256: 1efde84620ed1712f3387dd3fe315b8da7b643eaf928a6fc551d24d41d9980c3

Contents?: true

Size: 843 Bytes

Versions: 19

Compression:

Stored size: 843 Bytes

Contents

require 'cucumber/hooks'
module Cucumber::Hooks
  shared_examples_for 'a source node' do
    it "responds to name" do
      expect( subject.name ).to be_a(String)
    end

    it "responds to location" do
      expect( subject.location ).to eq(location)
    end

    it "responds to match_locations?" do
      expect( subject.match_locations? [location] ).to be_truthy
      expect( subject.match_locations? [] ).to be_falsey
    end
  end

  require 'cucumber/core/ast/location'
  describe BeforeHook do
    subject { BeforeHook.new(location) }
    let(:location) { Cucumber::Core::Ast::Location.new('hooks.rb', 1) }
    it_behaves_like 'a source node'
  end

  describe AfterHook do
    subject { AfterHook.new(location) }
    let(:location) { Cucumber::Core::Ast::Location.new('hooks.rb', 1) }
    it_behaves_like 'a source node'
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

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