Module: Covenant::DSL
- Defined in:
- lib/covenant.rb
Instance Method Summary collapse
-
#_assert(&block) ⇒ Object
Ensures that the condition on target evaluates to a true value.
Instance Method Details
#_assert(&block) ⇒ Object
Ensures that the condition on target evaluates to a true value.
37 38 39 40 41 |
# File 'lib/covenant.rb', line 37 def _assert(&block) raise ArgumentError, "no block given" unless block_given? tap { yield self or raise AssertionFailed, ErrorMessage.new(block) } end |