Sha256: 661bcd5180e9a6cf7147b323311a3cea7333c2f58929421eef82cc26c3786399

Contents?: true

Size: 865 Bytes

Versions: 4

Compression:

Stored size: 865 Bytes

Contents

require 'cucumber/core/test/hooks'
module Cucumber::Core::Test::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

4 entries across 4 versions & 1 rubygems

Version Path
cucumber-core-1.0.0.beta.4 spec/cucumber/core/test/hooks_spec.rb
cucumber-core-1.0.0.beta.3 spec/cucumber/core/test/hooks_spec.rb
cucumber-core-1.0.0.beta.2 spec/cucumber/core/test/hooks_spec.rb
cucumber-core-1.0.0.beta.1 spec/cucumber/core/test/hooks_spec.rb