Sha256: ad485254ea1c39883a3fbcc82505dc48f0e1427fe75ab49a25d1107979c73136

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

module Matchy
  module Assertions
    # Asserts that the given matcher returns true when +target+ is passed to #matches?
    def assert_accepts(matcher, target)
      success = matcher.matches?(target)
      assert_block(matcher.failure_message) { success }
    end

    # Asserts that the given matcher returns false when +target+ is passed to #matches?
    def assert_rejects(matcher, target)
      success = !matcher.matches?(target)
      assert_block(matcher.negative_failure_message) { success }
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mcmire-matchy-0.5.2 lib/matchy/assertions.rb
mcmire-matchy-0.5.1 lib/matchy/assertions.rb