Sha256: 648fbd38001214f5160d9dfd556f0940cb443d4ee8dbbb30aeedd4fc5ef84e16

Contents?: true

Size: 1.47 KB

Versions: 21

Compression:

Stored size: 1.47 KB

Contents

$cornucopia_matcher_extension_installed = false unless defined? $cornucopia_matcher_extension_installed

if Object.const_defined?("Capybara") &&
    Capybara.const_defined?("Node") &&
    Capybara::Node.const_defined?("Document") &&
    !$cornucopia_matcher_extension_installed
  module Capybara
    module Node
      class Document
        alias_method :__cornucopia_orig_assert_selector, :assert_selector
        alias_method :__cornucopia_orig_assert_no_selector, :assert_no_selector
        alias_method :__cornucopia_orig_has_selector?, :has_selector?
        alias_method :__cornucopia_orig_has_no_selector?, :has_no_selector?

        include Cornucopia::Capybara::MatcherExtensions
      end
    end
  end
end

if Object.const_defined?("Capybara") &&
    Capybara.const_defined?("Node") &&
    Capybara::Node.const_defined?("Element") &&
    !$cornucopia_matcher_extension_installed
  module Capybara
    module Node
      class Element
        alias_method :__cornucopia_orig_assert_selector, :assert_selector
        alias_method :__cornucopia_orig_assert_no_selector, :assert_no_selector
        alias_method :__cornucopia_orig_has_selector?, :has_selector?
        alias_method :__cornucopia_orig_has_no_selector?, :has_no_selector?

        include Cornucopia::Capybara::MatcherExtensions
      end
    end
  end
end

if Object.const_defined?("Capybara") &&
    Capybara.const_defined?("Session") &&
    !$cornucopia_matcher_extension_installed
  $cornucopia_matcher_extension_installed = true
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cornucopia-0.1.40 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.39 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.38 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.37 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.36 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.35 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.34 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.33 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.32 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.31 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.30 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.29 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.28 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.26 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.25 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.24 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.23 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.22 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.21 lib/cornucopia/capybara/install_matcher_extensions.rb
cornucopia-0.1.20 lib/cornucopia/capybara/install_matcher_extensions.rb