Sha256: bf25f153b13eae200d356efd6e79ef93a8df3f593570eb1e54a3d99aa2d7887e

Contents?: true

Size: 520 Bytes

Versions: 28

Compression:

Stored size: 520 Bytes

Contents

module Matchy::Expectations
  class BeAExpectation < Base
    def matches?(receiver)
      @receiver = receiver
      @receiver.is_a?(@expected)
    end

    def failure_message
      "Expected #{@receiver.inspect} to be a #{@expected.inspect}."
    end

    def negative_failure_message
      "Expected #{@receiver.inspect} to not be a #{@expected.inspect}."
    end
  end

  module TestCaseExtensions
    def be_a(obj)
      Matchy::Expectations::BeAExpectation.new(obj, self)
    end
    alias :be_an :be_a
  end
end

Version data entries

28 entries across 28 versions & 8 rubygems

Version Path
alphasights-integrity-0.1.10 test/helpers/expectations/be_a.rb
alphasights-integrity-0.1.9.3 test/helpers/expectations/be_a.rb
alphasights-integrity-0.1.9.4 test/helpers/expectations/be_a.rb
alphasights-integrity-0.1.9.5 test/helpers/expectations/be_a.rb
alphasights-integrity-0.1.9.6 test/helpers/expectations/be_a.rb
alphasights-integrity-0.1.9.7 test/helpers/expectations/be_a.rb
alphasights-integrity-0.1.9.8 test/helpers/expectations/be_a.rb
foca-integrity-0.1.9.0 test/helpers/expectations/be_a.rb
foca-integrity-0.1.9.1 test/helpers/expectations/be_a.rb
foca-integrity-0.1.9.2 test/helpers/expectations/be_a.rb
foca-integrity-0.1.9.3 test/helpers/expectations/be_a.rb
gforces-integrity-0.1.9.3 test/helpers/expectations/be_a.rb
gforces-integrity-0.1.9.4 test/helpers/expectations/be_a.rb
imbriaco-integrity-0.1.9.2.1 test/helpers/expectations/be_a.rb
imbriaco-integrity-0.1.9.2 test/helpers/expectations/be_a.rb
integrity-integrity-0.1.10 test/helpers/expectations/be_a.rb
integrity-integrity-0.1.9.3 test/helpers/expectations/be_a.rb
oliyoung-integrity-0.1.9.0 test/helpers/expectations/be_a.rb
sr-integrity-0.1.8.1 test/helpers/expectations/be_a.rb
sr-integrity-0.1.9.1 test/helpers/expectations/be_a.rb