You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

hooks_spec.rb 871 B

2 years ago
1234567891011121314151617181920212223242526272829303132
  1. # frozen_string_literal: true
  2. require 'cucumber/hooks'
  3. module Cucumber::Hooks
  4. shared_examples_for 'a source node' do
  5. it 'responds to text' do
  6. expect(subject.text).to be_a(String)
  7. end
  8. it 'responds to location' do
  9. expect(subject.location).to eq(location)
  10. end
  11. it 'responds to match_locations?' do
  12. expect(subject.match_locations?([location])).to be_truthy
  13. expect(subject.match_locations?([])).to be_falsey
  14. end
  15. end
  16. require 'cucumber/core/test/location'
  17. describe BeforeHook do
  18. subject { BeforeHook.new(location) }
  19. let(:location) { Cucumber::Core::Test::Location.new('hooks.rb', 1) }
  20. it_behaves_like 'a source node'
  21. end
  22. describe AfterHook do
  23. subject { AfterHook.new(location) }
  24. let(:location) { Cucumber::Core::Test::Location.new('hooks.rb', 1) }
  25. it_behaves_like 'a source node'
  26. end
  27. end

No Description

Contributors (1)