Module: RSpecHelpers
Relationships & Source Files | |
Defined in: | rspec-support/lib/rspec/support/spec/deprecation_helpers.rb |
Instance Method Summary
- #allow_deprecation
- #allow_warning
- #expect_deprecation_with_call_site(file, line, snippet = //)
- #expect_deprecation_without_call_site(snippet = //)
-
#expect_no_deprecation
Alias for #expect_no_deprecations.
- #expect_no_deprecations (also: #expect_no_deprecation)
- #expect_no_warnings
- #expect_warn_deprecation(snippet = //)
- #expect_warn_deprecation_with_call_site(file, line, snippet = //)
- #expect_warning_with_call_site(file, line, expected = //)
- #expect_warning_without_call_site(expected = //)
Instance Method Details
#allow_deprecation
[ GitHub ]# File 'rspec-support/lib/rspec/support/spec/deprecation_helpers.rb', line 24
def allow_deprecation allow(RSpec.configuration.reporter).to receive(:deprecation) end
#allow_warning
[ GitHub ]#expect_deprecation_with_call_site(file, line, snippet = //)
[ GitHub ]# File 'rspec-support/lib/rspec/support/spec/deprecation_helpers.rb', line 4
def expect_deprecation_with_call_site(file, line, snippet=//) expect(RSpec.configuration.reporter).to receive(:deprecation). with(include(:deprecated => match(snippet), :call_site => include([file, line].join(':')))) end
#expect_deprecation_without_call_site(snippet = //)
[ GitHub ]# File 'rspec-support/lib/rspec/support/spec/deprecation_helpers.rb', line 9
def expect_deprecation_without_call_site(snippet=//) expect(RSpec.configuration.reporter).to receive(:deprecation). with(include(:deprecated => match(snippet), :call_site => eq(nil))) end
#expect_no_deprecation
Alias for #expect_no_deprecations.
# File 'rspec-support/lib/rspec/support/spec/deprecation_helpers.rb', line 31
alias expect_no_deprecation expect_no_deprecations
#expect_no_deprecations Also known as: #expect_no_deprecation
[ GitHub ]# File 'rspec-support/lib/rspec/support/spec/deprecation_helpers.rb', line 28
def expect_no_deprecations expect(RSpec.configuration.reporter).not_to receive(:deprecation) end
#expect_no_warnings
[ GitHub ]#expect_warn_deprecation(snippet = //)
[ GitHub ]# File 'rspec-support/lib/rspec/support/spec/deprecation_helpers.rb', line 19
def expect_warn_deprecation(snippet=//) expect(RSpec.configuration.reporter).to receive(:deprecation). with(include(: => match(snippet))) end
#expect_warn_deprecation_with_call_site(file, line, snippet = //)
[ GitHub ]# File 'rspec-support/lib/rspec/support/spec/deprecation_helpers.rb', line 14
def expect_warn_deprecation_with_call_site(file, line, snippet=//) expect(RSpec.configuration.reporter).to receive(:deprecation). with(include(: => match(snippet), :call_site => include([file, line].join(':')))) end