Module: Excom::Plugins::Assertions

Defined in:
lib/excom/plugins/assertions.rb

Instance Method Summary collapse

Instance Method Details

#assert(fail_with: self.fail_with) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/excom/plugins/assertions.rb', line 5

def assert(fail_with: self.fail_with)
  if yield
    status :success unless defined?(@status)
  else
    failure!(fail_with)
  end
end