Sha256: f0aefa748fad7a9d5f90d223d979a4897180f3dfc63f0259e369cc46a2dbd838

Contents?: true

Size: 377 Bytes

Versions: 65

Compression:

Stored size: 377 Bytes

Contents

# frozen_string_literal: true

require "rspec-html-matchers"

RSpec::Matchers.define(:have_equivalent_markup_to) do |expected|
  cleaner = ->(str) { str.gsub(/>[[:space:]]*/, ">").gsub(/[[:space:]]*</, "<").strip }

  match do |actual|
    cleaner.call(expected) == cleaner.call(actual)
  end

  diffable
end

RSpec.configure do |config|
  config.include RSpecHtmlMatchers
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
decidim-dev-0.26.10 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.9 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.8 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.7 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.5 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.4 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.3 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.2 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.1 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.0 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.0.rc2 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.26.0.rc1 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.25.2 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.25.1 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.25.0 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.25.0.rc4 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.25.0.rc3 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.25.0.rc2 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.25.0.rc1 lib/decidim/dev/test/rspec_support/html_matchers.rb
decidim-dev-0.24.3 lib/decidim/dev/test/rspec_support/html_matchers.rb