class Capybara::RSpecMatchers::HaveText
Attributes
content[R]
failure_message[R]
failure_message_for_should[R]
failure_message_for_should_not[R]
failure_message_when_negated[R]
options[R]
type[R]
Public Class Methods
new(*args)
click to toggle source
# File lib/capybara/rspec/matchers.rb, line 55 def initialize(*args) @args = args.dup # are set just for backwards compatability @type = args.shift if args.first.is_a?(Symbol) @content = args.shift @options = (args.first.is_a?(Hash))? args.first : {} end
Public Instance Methods
description()
click to toggle source
# File lib/capybara/rspec/matchers.rb, line 78 def description "text #{format(content)}" end
does_not_match?(actual)
click to toggle source
# File lib/capybara/rspec/matchers.rb, line 71 def does_not_match?(actual) wrap(actual).assert_no_text(*@args) rescue Capybara::ExpectationNotMet => e @failure_message_when_negated = e.message return false end
format(content)
click to toggle source
# File lib/capybara/rspec/matchers.rb, line 82 def format(content) content = Capybara::Helpers.normalize_whitespace(content) unless content.is_a? Regexp content.inspect end
matches?(actual)
click to toggle source
# File lib/capybara/rspec/matchers.rb, line 64 def matches?(actual) wrap(actual).assert_text(*@args) rescue Capybara::ExpectationNotMet => e @failure_message = e.message return false end