Sha256: 5dd3194f1d8d776a9369299fe6d6faf80954abc4a7056a49f36deed97dd5f979
Contents?: true
Size: 994 Bytes
Versions: 36
Compression:
Stored size: 994 Bytes
Contents
# frozen_string_literal: true require File.expand_path('../../spec_helper', __dir__) require_relative '../../helpers/exception_helpers' require "exception_handling/testing" module ExceptionHandling describe LoggingMethods do include ExceptionHelpers def dont_stub_log_error true end context "ExceptionHandling::LoggingMethods" do before do @controller = Testing::LoggingMethodsControllerStub.new ExceptionHandling.stub_handler = nil end context "#log_warning" do it "be available to the controller" do klass = Class.new klass.include ExceptionHandling::LoggingMethods instance = klass.new expect(instance.methods.include?(:log_warning)).to eq(true) end it "call ExceptionHandling#log_warning" do expect(ExceptionHandling).to receive(:log_warning).with("Hi mom") @controller.send(:log_warning, "Hi mom") end end end end end
Version data entries
36 entries across 36 versions & 1 rubygems