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
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