Sha256: 8ca785885590a84cacbd372922d47a9877cf90fc26bf0820c192d0243ebdf156

Contents?: true

Size: 607 Bytes

Versions: 44

Compression:

Stored size: 607 Bytes

Contents

# frozen_string_literal: true

require 'capybara/rspec/matchers/base'

module Capybara
  module RSpecMatchers
    module Matchers
      class HaveText < WrappedElementMatcher
        def element_matches?(el)
          el.assert_text(*@args)
        end

        def element_does_not_match?(el)
          el.assert_no_text(*@args)
        end

        def description
          "text #{format(text)}"
        end

        def format(content)
          content.inspect
        end

      private

        def text
          @args[0].is_a?(Symbol) ? @args[1] : @args[0]
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 3 rubygems

Version Path
isomorfeus-puppetmaster-0.5.7 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.5.6 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.5.5 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.5.4 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.5.3 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.5.2 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.5.1 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.5.0 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.4.1 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.4.0 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.3.5 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.3.4 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.3.3 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.3.2 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.3.1 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.3.0 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.2.9 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.2.8 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.2.7 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb
isomorfeus-puppetmaster-0.2.6 lib/isomorfeus/puppetmaster/rspec/matchers/have_text.rb