mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
b7e02184d9
- bump rubocop to v1.0 - Fix Layout/MultilineAssignmentLayout and other remaining offences - Exculde appraisal generated gemfiles in rubocop - Replace NON_NUMERIC_VALUE constant with instance method against failing test case in rails <= 5.1 and postgres adapter. This is a defect in rails where a frozen string is modified in https://github.com/rails/rails/blob/v5.1.7/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb#L25
39 lines
1,011 B
Ruby
39 lines
1,011 B
Ruby
require 'forwardable'
|
|
require 'logger'
|
|
|
|
module Shoulda
|
|
module Matchers
|
|
# @private
|
|
module Doublespeak
|
|
class << self
|
|
extend Forwardable
|
|
|
|
def_delegators :world, :double_collection_for,
|
|
:with_doubles_activated
|
|
|
|
def world
|
|
@_world ||= World.new
|
|
end
|
|
|
|
def debugging_enabled?
|
|
ENV['DEBUG_DOUBLESPEAK'] == '1'
|
|
end
|
|
|
|
def debug(&block)
|
|
if debugging_enabled?
|
|
puts block.call # rubocop:disable Rails/Output
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
require 'shoulda/matchers/doublespeak/double'
|
|
require 'shoulda/matchers/doublespeak/double_collection'
|
|
require 'shoulda/matchers/doublespeak/double_implementation_registry'
|
|
require 'shoulda/matchers/doublespeak/method_call'
|
|
require 'shoulda/matchers/doublespeak/object_double'
|
|
require 'shoulda/matchers/doublespeak/proxy_implementation'
|
|
require 'shoulda/matchers/doublespeak/stub_implementation'
|
|
require 'shoulda/matchers/doublespeak/world'
|