Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions spec/rspec/core/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def mod.configuration; @config ||= Struct.new(:custom_setting).new; end
it_behaves_like "a configurable framework adapter", :mock_with

it "allows rspec-mocks to be configured with a provided block" do
skip unless RSpec::Mocks.configuration.respond_to?(:add_stub_and_should_receive_to)
mod = Module.new

expect(RSpec::Mocks.configuration).to receive(:add_stub_and_should_receive_to).with(mod)
Expand Down Expand Up @@ -2724,9 +2725,13 @@ def strategy.order(list)
def in_fully_monkey_patched_rspec_environment
in_sub_process do
config.expose_dsl_globally = true
mocks.configuration.syntax = [:expect, :should]
if mocks.configuration.respond_to?(:syntax)
mocks.configuration.syntax = [:expect, :should]
end
mocks.configuration.patch_marshal_to_support_partial_doubles = true
expectations.configuration.syntax = [:expect, :should]
if expectations.configuration.respond_to?(:syntax)
expectations.configuration.syntax = [:expect, :should]
end

yield
end
Expand All @@ -2742,6 +2747,7 @@ def in_fully_monkey_patched_rspec_environment
end

it 'stops using should syntax for expectations' do
skip unless expectations.configuration.respond_to?(:syntax)
in_fully_monkey_patched_rspec_environment do
obj = Object.new
config.expect_with :rspec
Expand All @@ -2752,6 +2758,7 @@ def in_fully_monkey_patched_rspec_environment
end

it 'stops using should syntax for mocks' do
skip unless mocks.configuration.respond_to?(:syntax)
in_fully_monkey_patched_rspec_environment do
obj = Object.new
config.mock_with :rspec
Expand Down Expand Up @@ -2781,6 +2788,7 @@ def emulate_not_configured_mock_framework
end

it 'disables monkey patching after example groups being configured' do
skip unless mocks.configuration.respond_to?(:syntax)
emulate_not_configured_mock_framework do
obj = Object.new
config.disable_monkey_patching!
Expand All @@ -2804,6 +2812,7 @@ def emulate_not_configured_expectation_framework
end

it 'disables monkey patching after example groups being configured' do
skip unless expectations.configuration.respond_to?(:syntax)
emulate_not_configured_expectation_framework do
obj = Object.new
config.disable_monkey_patching!
Expand Down