Sha256: d12928992ec71ae6103c8f1c31f35de16ffd35b67ef1bf72320b5b4668adf914

Contents?: true

Size: 565 Bytes

Versions: 8

Compression:

Stored size: 565 Bytes

Contents

require "rspec"

RSpec::Matchers.define :have_content do |expected|
  match do |actual|
    actual.content.include? expected
  end
  failure_message_for_should do |actual|
    "expected \"#{actual.content.join("\n")}\" to include \"#{expected}\""
  end
end

RSpec::Matchers.define :have_text do |expected|
  match do |actual|
    actual.has_text? expected
  end
  failure_message_for_should do |actual|
    <<-FAIL
    expected "#{actual.content.join("\n")}" to include "#{expected}"
    all content on page:
    #{actual.all_content.join("\n")}
    FAIL
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
acouchi-0.0.14 lib/acouchi/rspec/matchers.rb
acouchi-0.0.13 lib/acouchi/rspec/matchers.rb
acouchi-0.0.12 lib/acouchi/rspec/matchers.rb
acouchi-0.0.11 lib/acouchi/rspec/matchers.rb
acouchi-0.0.10 lib/acouchi/rspec/matchers.rb
acouchi-0.0.9 lib/acouchi/rspec/matchers.rb
acouchi-0.0.8 lib/acouchi/rspec/matchers.rb
acouchi-0.0.7 lib/acouchi/rspec/matchers.rb