Sha256: 481eec5c4322864fced9e5992a4b846c3210a6495bc65e3d10b3c2b06fba7d65

Contents?: true

Size: 1.83 KB

Versions: 7

Compression:

Stored size: 1.83 KB

Contents

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

require 'rspec/retry'

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.filter_run :focus

  config.mock_with :rspec do |mocks|
    # This option should be set when all dependencies are being loaded
    # before a spec run, as is the case in a typical spec helper. It will
    # cause any verifying double instantiation for a class that does not
    # exist to raise, protecting against incorrectly spelt names.
    mocks.verify_doubled_constant_names = true
  end

  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = 'random'

  config.before(:example) do
    WebMock.disable!
  end

  config.before(:example, :webmock) do
    allow(TestApp).to receive(:instance).and_return(instance_double('TestApp',
      app_id: 'app_id',
      key_id: 'app_id.key_id',
      api_key: 'app_id.key_id:secret',
      environment: 'sandbox'
    ))
    WebMock.enable!
  end

  if defined?(EventMachine)
    config.before(:example) do
      # Ensure EventMachine shutdown hooks are deregistered for every test
      EventMachine.instance_variable_set '@tails', []
    end
  end

  config.add_formatter Ably::RSpec::PrivateApiFormatter

  if ENV['RSPEC_RETRY']
    puts 'Running tests using RSpec retry'
    config.verbose_retry = true # show retry status in spec process
    config.default_retry_count = 3
    config.default_sleep_interval = 2
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
ably-0.7.6 spec/rspec_config.rb
ably-rest-0.7.5 lib/submodules/ably-ruby/spec/rspec_config.rb
ably-0.7.5 spec/rspec_config.rb
ably-0.7.4 spec/rspec_config.rb
ably-rest-0.7.3 lib/submodules/ably-ruby/spec/rspec_config.rb
ably-0.7.2 spec/rspec_config.rb
ably-0.7.1 spec/rspec_config.rb