Module: AE::Okay

Included in:
Object
Defined in:
lib/ae/ok.rb

Instance Method Summary collapse

Instance Method Details

#check(msg = nil, &block) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/ae/ok.rb', line 10

def check(msg=nil, &block)
  if block.arity == 0
    @__c__ = nil
    assert(block.call, msg)
  else
    @__c__ = [block, msg]
  end
end

#no(*args) ⇒ Object



26
27
28
29
# File 'lib/ae/ok.rb', line 26

def no(*args)
  block, msg = *@__c__
  refute(block.call(*args), msg)
end

#ok(*args) ⇒ Object



20
21
22
23
# File 'lib/ae/ok.rb', line 20

def ok(*args)
  block, msg = *@__c__
  assert(block.call(*args), msg)
end