Module: RSpecHelpers

### Home Classes Methods

### In Files

- lib/rspec/support/spec/deprecation_helpers.rb

### Methods

- #allow_deprecation
- #allow_warning
- #expect_deprecation_with_call_site
- #expect_deprecation_without_call_site
- #expect_no_deprecation
- #expect_no_deprecations
- #expect_warn_deprecation
- #expect_warn_deprecation_with_call_site
- #expect_warning_with_call_site
- #expect_warning_without_call_site

### Class/Module Index

Quicksearch

- RSpec
- RSpec::CallerFilter
- RSpec::Support
- RSpec::Support::BlockSignature
- RSpec::Support::Differ
- RSpec::Support::DirectoryMaker
- RSpec::Support::EncodedString
- RSpec::Support::FormattingSupport
- RSpec::Support::FuzzyMatcher
- RSpec::Support::HunkGenerator
- RSpec::Support::InSubProcess
- RSpec::Support::LooseSignatureVerifier
- RSpec::Support::LooseSignatureVerifier::SignatureWithKeywordArgumentsMatcher
- RSpec::Support::MethodSignature
- RSpec::Support::MethodSignatureVerifier
- RSpec::Support::OS
- RSpec::Support::RecursiveConstMethods
- RSpec::Support::Ruby
- RSpec::Support::RubyFeatures
- RSpec::Support::ShellOut
- RSpec::Support::Spec
- RSpec::Support::StdErrSplitter
- RSpec::Support::StrictSignatureVerifier
- RSpec::Support::Version
- RSpec::Support::VersionChecker
- RSpec::Support::Warnings
- RSpec::Support::WarningsPrevention
- RSpec::Support::WithIsolatedStdErr
- Object
- RSpecHelpers

No matching classes.

# RSpecHelpers

### Public Instance Methods

allow_deprecation() click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 35
    def allow_deprecation
      allow(RSpec.configuration.reporter).to receive(:deprecation)
    end

allow_warning() click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 57
    def allow_warning
      allow(::Kernel).to receive(:warn)
    end

expect_deprecation_with_call_site(file, line, snippet=//) click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 6
    def expect_deprecation_with_call_site(file, line, snippet=//)
      expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
        expect(options[:call_site]).to include([file, line].join(':'))
        expect(options[:deprecated]).to match(snippet)
      end
    end

expect_deprecation_without_call_site(snippet=//) click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 13
    def expect_deprecation_without_call_site(snippet=//)
      expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
        expect(options[:call_site]).to eq nil
        expect(options[:deprecated]).to match(snippet)
      end
    end

expect_no_deprecation() click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 2
    def expect_no_deprecation
      expect(RSpec.configuration.reporter).not_to receive(:deprecation)
    end

expect_no_deprecations() click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 39
    def expect_no_deprecations
      expect(RSpec.configuration.reporter).not_to receive(:deprecation)
    end

expect_warn_deprecation(snippet=//) click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 28
    def expect_warn_deprecation(snippet=//)
      expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
        message = options[:message]
        expect(message).to match(snippet)
      end
    end

expect_warn_deprecation_with_call_site(file, line, snippet=//) click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 20
    def expect_warn_deprecation_with_call_site(file, line, snippet=//)
      expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
        message = options[:message]
        expect(message).to match(snippet)
        expect(message).to include([file, line].join(':'))
      end
    end

expect_warning_with_call_site(file, line, expected=//) click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 50
    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

expect_warning_without_call_site(expected=//) click to toggle source

    # File lib/rspec/support/spec/deprecation_helpers.rb, line 43
    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

[Validate]

Generated with the Darkfish Rdoc Generator 2.