Sha256: b3e3332952d6b072e56a12e1ca1b8c9f8e96f396ec6b5407b2e4ab40374e5b89

Contents?: true

Size: 526 Bytes

Versions: 10

Compression:

Stored size: 526 Bytes

Contents

module Matchers
  class BeLike
    def initialize(expected)
      @expected = expected.gsub(/>\s*\n\s*/, '> ').gsub(/\s+/, ' ').strip
    end

    def matches?(actual)
      @actual = actual.gsub(/>\s*\n\s*/, '> ').gsub(/\s+/, ' ').strip
      @expected == @actual
    end

    def failure_message
      "expected\n#{@actual}\nto be like\n#{@expected}"
    end

    def negative_failure_message
      "expected\n#{@actual}\nto be unlike\n#{@expected}"
    end
  end

  def be_like(expected)
    BeLike.new(expected)
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
mondrian-olap-1.2.0 spec/support/matchers/be_like.rb
mondrian-olap-1.1.0 spec/support/matchers/be_like.rb
mondrian-olap-0.8.0 spec/support/matchers/be_like.rb
mondrian-olap-0.7.0 spec/support/matchers/be_like.rb
mondrian-olap-0.6.0 spec/support/matchers/be_like.rb
mondrian-olap-0.5.0 spec/support/matchers/be_like.rb
rubiks-0.0.6 spec/support/matchers/be_like.rb
rubiks-0.0.5 spec/support/matchers/be_like.rb
rubiks-0.0.4 spec/support/matchers/be_like.rb
mondrian-olap-0.4.0-java spec/support/matchers/be_like.rb