Sha256: aee693c0814d182c0dff1f2b858c5931ec02f9cc11a30a32910b0a6cc26a3766

Contents?: true

Size: 935 Bytes

Versions: 2

Compression:

Stored size: 935 Bytes

Contents

# frozen_string_literal: true

::RSpec.configure do |config|
  config.around(:each, verify: false) do |example|
    config.rspeckled_logger.debug("Around Each  - Start - #{__FILE__}")

    verify_partial  = ::RSpec::Mocks
                        .configuration
                        .instance_variable_get(:@verify_partial_doubles)
    verify_constant = ::RSpec::Mocks
                        .configuration
                        .instance_variable_get(:@verify_doubled_constant_names)

    ::RSpec::Mocks.configuration.verify_partial_doubles        = example.metadata[:verify]
    ::RSpec::Mocks.configuration.verify_doubled_constant_names = example.metadata[:verify]

    example.run

    ::RSpec::Mocks.configuration.verify_partial_doubles        = verify_partial
    ::RSpec::Mocks.configuration.verify_doubled_constant_names = verify_constant

    config.rspeckled_logger.debug("Around Each  - End   - #{__FILE__}")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspeckled-2.1.1 lib/rspeckled/plugins/hooks/rspec_mocks.rb
rspeckled-2.1.0 lib/rspeckled/plugins/hooks/rspec_mocks.rb