class Object

Public Instance Methods

capture_exception(exception_class=nil, &block) click to toggle source
# File lib/matest/capture_exception.rb, line 6
def capture_exception(exception_class=nil, &block)
  expected_exception = exception_class || BasicObject
  begin
    block.call
    if exception_class
      raise Matest::NoExceptionRaised.new("Expected '#{exception_class.inspect}' from the block, but none was raised.")
    else
      raise Matest::NoExceptionRaised.new("Expected an Exception from the block, but none was raised.")
    end
    false
  rescue Matest::NoExceptionRaised => e
    raise e
  rescue expected_exception => e
    e
  rescue BasicObject => e
    raise e
  end
end
context(description=nil, &block)
Alias for: scope
describe(description=nil, &block)
Alias for: scope
group(description=nil, &block)
Alias for: scope
scope(description=nil, &block) click to toggle source
# File lib/matest/top_level_methods.rb, line 1
def scope(description=nil, &block)
  Matest::Runner.runner << Matest::ExampleGroup.new(block)
end
Also aliased as: describe, context, group
xcontext(description=nil, &block)
Alias for: xscope
xdescribe(description=nil, &block)
Alias for: xscope
xgroup(description=nil, &block)
Alias for: xscope
xscope(description=nil, &block) click to toggle source
# File lib/matest/top_level_methods.rb, line 5
def xscope(description=nil, &block)
  Matest::Runner.runner << Matest::SkippedExampleGroup.new(block)
end
Also aliased as: xdescribe, xcontext, xgroup