Sha256: 71b2726550dd81d62ccd7e0b7852fdbf86cb17f9127cc0453b000a341a288018
Contents?: true
Size: 842 Bytes
Versions: 7
Compression:
Stored size: 842 Bytes
Contents
module RSpecHelpers def expect_deprecation_with_call_site(file, line) expect(RSpec.configuration.reporter).to receive(:deprecation) do |options| expect(options[:call_site]).to include([file, line].join(':')) end end def allow_deprecation allow(RSpec.configuration.reporter).to receive(:deprecation) end def expect_warning_without_call_site(expected = //) expect(::Kernel).to receive(:warn) do |message| expect(message).to match expected expect(message).to_not match(/Called from/) end end def expect_warning_with_call_site(file, line, expected = //) expect(::Kernel).to receive(:warn) do |message| expect(message).to match expected expect(message).to match(/Called from #{file}:#{line}/) end end def allow_warning allow(::Kernel).to receive(:warn) end end
Version data entries
7 entries across 7 versions & 3 rubygems