Module: Nanoc::Core::Assertions::Mixin

Included in:
CompilationStages::CompileReps, ItemRepWriter
Defined in:
lib/nanoc/core/assertions.rb

Instance Method Summary collapse

Instance Method Details

#assert(assertion) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/nanoc/core/assertions.rb', line 10

def assert(assertion)
  return unless Nanoc::Core::ContractsSupport.enabled?

  unless assertion.call
    raise AssertionFailure, "assertion failed: #{assertion.class}"
  end
end