method
has
1.1.12 -
Show latest stable
-
0 notes -
Class: Spec::Matchers
- 1.1.4
- 1.1.12 (0)
- 1.2.0
- 1.2.8
- 1.3.0
- 1.3.1
- What's this?
has(sym, *args)
public
Hide source
# File lib/spec/matchers/has.rb, line 3 def has(sym, *args) # :nodoc: simple_matcher do |actual, matcher| matcher.failure_message = "expected ##{predicate(sym)}(#{args[0].inspect}) to return true, got false" matcher.negative_failure_message = "expected ##{predicate(sym)}(#{args[0].inspect}) to return false, got true" matcher.description = "have key #{args[0].inspect}" actual.__send__(predicate(sym), *args) end end