mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Move CountSugar inclusion into a base class
This commit is contained in:
parent
62bd0f97c5
commit
a624220a70
6 changed files with 9 additions and 12 deletions
|
@ -20,6 +20,7 @@ engines:
|
|||
exclude_patterns:
|
||||
- "lib/capybara/selector.rb"
|
||||
- "lib/capybara/minitest.rb"
|
||||
- "lib/capybara/selector/definiton/"
|
||||
eslint:
|
||||
enabled: false
|
||||
fixme:
|
||||
|
|
|
@ -65,6 +65,10 @@ module Capybara
|
|||
end
|
||||
end
|
||||
|
||||
class CountableWrappedElementMatcher < WrappedElementMatcher
|
||||
include CountSugar
|
||||
end
|
||||
|
||||
class NegatedMatcher
|
||||
include ::Capybara::RSpecMatchers::Matchers::Compound if defined?(::Capybara::RSpecMatchers::Matchers::Compound)
|
||||
|
||||
|
|
|
@ -6,9 +6,7 @@ require 'capybara/rspec/matchers/count_sugar'
|
|||
module Capybara
|
||||
module RSpecMatchers
|
||||
module Matchers
|
||||
class HaveAncestor < WrappedElementMatcher
|
||||
include CountSugar
|
||||
|
||||
class HaveAncestor < CountableWrappedElementMatcher
|
||||
def element_matches?(el)
|
||||
el.assert_ancestor(*@args, &@filter_block)
|
||||
end
|
||||
|
|
|
@ -6,9 +6,7 @@ require 'capybara/rspec/matchers/count_sugar'
|
|||
module Capybara
|
||||
module RSpecMatchers
|
||||
module Matchers
|
||||
class HaveSelector < WrappedElementMatcher
|
||||
include CountSugar
|
||||
|
||||
class HaveSelector < CountableWrappedElementMatcher
|
||||
def element_matches?(el)
|
||||
el.assert_selector(*@args, &@filter_block)
|
||||
end
|
||||
|
|
|
@ -6,9 +6,7 @@ require 'capybara/rspec/matchers/count_sugar'
|
|||
module Capybara
|
||||
module RSpecMatchers
|
||||
module Matchers
|
||||
class HaveSibling < WrappedElementMatcher
|
||||
include CountSugar
|
||||
|
||||
class HaveSibling < CountableWrappedElementMatcher
|
||||
def element_matches?(el)
|
||||
el.assert_sibling(*@args, &@filter_block)
|
||||
end
|
||||
|
|
|
@ -6,9 +6,7 @@ require 'capybara/rspec/matchers/count_sugar'
|
|||
module Capybara
|
||||
module RSpecMatchers
|
||||
module Matchers
|
||||
class HaveText < WrappedElementMatcher
|
||||
include CountSugar
|
||||
|
||||
class HaveText < CountableWrappedElementMatcher
|
||||
def element_matches?(el)
|
||||
el.assert_text(*@args)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue