Class: Riot::NilMacro
- Inherits:
-
AssertionMacro
- Object
- AssertionMacro
- Riot::NilMacro
- Defined in:
- lib/riot/assertion_macros/nil.rb
Overview
Asserts that the result of the test is nil
asserts("test") { nil }.nil
should("test") { nil }.nil
Instance Attribute Summary
Attributes inherited from AssertionMacro
Instance Method Summary collapse
Methods inherited from AssertionMacro
default, #error, #expected_message, expects_exception!, #expects_exception?, #fail, #new_message, #pass, register, #should_have_message
Instance Method Details
#evaluate(actual) ⇒ Object
8 9 10 |
# File 'lib/riot/assertion_macros/nil.rb', line 8 def evaluate(actual) actual.nil? ? pass("is nil") : fail(.nil.not(actual)) end |