mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-18 20:40:03 +08:00
21 lines
743 B
Ruby
Vendored
21 lines
743 B
Ruby
Vendored
# frozen_string_literal: true
|
||
|
||
# Mock framework setup: rspec-mocks and Mocha used together via rspec-multi-mock.
|
||
|
||
# To avoid erasing `any_instance` from Mocha
|
||
require "rspec/mocks/syntax"
|
||
RSpec::Mocks::Syntax.singleton_class.define_method(:enable_should) { |*| nil }
|
||
RSpec::Mocks::Syntax.singleton_class.define_method(:disable_should) { |*| nil }
|
||
|
||
RSpec::Mocks::ArgumentMatchers.remove_method(:hash_including) # We’re currently relying on the version from Webmock
|
||
|
||
RSpec.configure do |config|
|
||
config.mock_with :rspec do |mocks|
|
||
mocks.verify_partial_doubles = true
|
||
mocks.verify_doubled_constant_names = true
|
||
mocks.syntax = :expect
|
||
end
|
||
config.mock_with MultiMock::Adapter.for(:mocha, :rspec)
|
||
|
||
config.include Mocha::API
|
||
end
|