Class Spec::Matchers::Has

  1. lib/spec/matchers/has.rb
Parent: Object

Public class methods

new (expected, *args)
[show source]
# File lib/spec/matchers/has.rb, line 6
      def initialize(expected, *args)
        @expected, @args = expected, args
      end

Public instance methods

description ()
[show source]
# File lib/spec/matchers/has.rb, line 22
      def description
        "have key #{@args[0].inspect}"
      end
failure_message_for_should ()
[show source]
# File lib/spec/matchers/has.rb, line 14
      def failure_message_for_should
        "expected ##{predicate(@expected)}(#{@args[0].inspect}) to return true, got false"
      end
failure_message_for_should_not ()
[show source]
# File lib/spec/matchers/has.rb, line 18
      def failure_message_for_should_not
        "expected ##{predicate(@expected)}(#{@args[0].inspect}) to return false, got true"
      end
matches? (actual)
[show source]
# File lib/spec/matchers/has.rb, line 10
      def matches?(actual)
        actual.__send__(predicate(@expected), *@args)
      end