module Classifile::AssertChecker

Wrapper class for Minitest::Assertions. Wrap and convert to Failed error when minitest's Assert method is called.

Public Instance Methods

method_missing(name, *args) click to toggle source

Provides assert methods of minitest.

# File lib/classifile/checker/assert_checker.rb, line 25
def method_missing(name, *args)
  @assert = Asserter.new if @assert.nil?
  unless @assert.respond_to?(name) && name.to_s.include?("assert")
    raise NoMethodError.new("Method '#{name}' not found", name)
  end

  begin
    @assert.send name, *args
  rescue MiniTest::Assertion
    raise Failed unless @gotcha
  end
end
respond_to_missing?(sym, *) click to toggle source
Calls superclass method
# File lib/classifile/checker/assert_checker.rb, line 38
def respond_to_missing?(sym, *)
  if sym.to_s.include?("assert")
    @assert.respond_to?(sym) ? true : super
  else
    super
  end
end