class ExecutionAssay

Assert that a block of coded executes without error and does not return nil or false.

NOTE: To test only for successful execution regardless of return value use a negated {RaiseAssay} on the Exception class. But generally this would be pretty silly, if you think about it, this is exactly what testing is for!

Public Class Methods

assert_message(*arguments, &block) click to toggle source
# File lib/assay/execution_assay.rb, line 54
def self.assert_message(*arguments, &block)
  "#{block}.call(*#{arguments.inspect})"
end
fail?(*arguments, &block) click to toggle source

Check negated assertion.

# File lib/assay/execution_assay.rb, line 29
def self.fail?(*arguments, &block)
  begin
    ! block.call(*arguments)
  rescue Exception
    true
  end
end
pass?(*arguments, &block) click to toggle source

Check assertion.

# File lib/assay/execution_assay.rb, line 18
def self.pass?(*arguments, &block)
  begin
    block.call(*arguments)
  rescue Exception
    false
  end
end