class RSpec::Rails::AssertionDelegator
@private
def assertion_instance
def assertion_instance @assertion_instance ||= build_assertion_instance end
def initialize(*assertion_modules)
def initialize(*assertion_modules) assertion_class = Class.new(SimpleDelegator) do include ::RSpec::Rails::Assertions include ::RSpec::Rails::MinitestCounters assertion_modules.each { |mod| include mod } end super() do define_method :build_assertion_instance do assertion_class.new(self) end def assertion_instance @assertion_instance ||= build_assertion_instance end assertion_modules.each do |mod| mod.public_instance_methods.each do |method| next if method == :method_missing || method == "method_missing" define_method(method.to_sym) do |*args, &block| assertion_instance.send(method.to_sym, *args, &block) end end end end end