Method: Riot::RespondToMacro#devaluate
- Defined in:
- lib/riot/assertion_macros/respond_to.rb
#devaluate(actual, expected) ⇒ Array
Supports negative/converse assertion testing. This is also where magic happens.
26 27 28 29 30 31 32 |
# File 'lib/riot/assertion_macros/respond_to.rb', line 26 def devaluate(actual, expected) if actual.respond_to?(expected) fail(.method(expected).is_defined) else pass .responds_to(expected) end end |