Sha256: 4744ffa40df9a657c17a0b16441c434c981c0951b5a69441cd099ecd889d6f6f

Contents?: true

Size: 1.11 KB

Versions: 10

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

ENV['RUBY_ENV'] = 'test'

require 'simplecov'

SimpleCov.start

require 'rspec/collection_matchers'
require 'webmock/rspec'
require 'pry'
require 'support/matchers'
require 'support/helpers'
require 'support/vcr_setup'

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

  config.extend Helpers # Allow access to helpers in describe and context blocks
  config.include Helpers # Allow access to helpers in it and let blocks

  config.include Helpers::Repositories, integration: true
  config.include Matchers::Type, type: :type

  config.order = 'random'

  WebMock.disable_net_connect!(allow: 'codeclimate.com')

  config.before do
    module Test
      def self.remove_constants
        constants.each { |const| remove_const(const) }
        self
      end
    end
  end

  config.after do
    Object.send(:remove_const, Test.remove_constants.name)
  end

  # Reset configuration after each test run
  config.after do
    Fortnox::API::DEFAULT_CONFIGURATION.each do |key, value|
      Fortnox::API.config.send("#{key}=", value)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fortnox-api-0.8.2 spec/spec_helper.rb
fortnox-api-0.8.1 spec/spec_helper.rb
fortnox-api-0.8.0 spec/spec_helper.rb
fortnox-api-0.7.2 spec/spec_helper.rb
fortnox-api-0.7.1 spec/spec_helper.rb
fortnox-api-0.7.0 spec/spec_helper.rb
fortnox-api-0.6.3 spec/spec_helper.rb
fortnox-api-0.6.2 spec/spec_helper.rb
fortnox-api-0.6.1 spec/spec_helper.rb
fortnox-api-0.6.0 spec/spec_helper.rb