Sha256: 2a485cd96b27fafe0dcc94d0bb372e2f5ad53c375e7adb6518c47486edb64e16

Contents?: true

Size: 493 Bytes

Versions: 1

Compression:

Stored size: 493 Bytes

Contents

RSpec::Matchers.define :be_page_for do |klass|
  match do |page|
    meta = page.locator("meta[name='class']")
    expect(meta).to have_attribute("content", klass.name)
  end
  failure_message do |page|
    meta = page.locator("meta[name='class']")
    if meta.count == 0
      "Could not find <meta name='class'> on the page:\n\n#{page.content}"
    else
      "Could not find <meta name='class' content='#{klass.name}'>, but found:\n\n#{meta.evaluate('e => e.outerHTML')}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brut-0.0.1 lib/brut/spec_support/matchers/be_page_for.rb