Sha256: 0f46e26fb7bc269d1a42f2b119eb8063a4eb074f8cd233d3f5fd01672ec65f86

Contents?: true

Size: 1.4 KB

Versions: 18

Compression:

Stored size: 1.4 KB

Contents

# frozen_string_literal: true

$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
$LOAD_PATH << File.join(File.dirname(__FILE__))

require 'rubygems'
require 'rspec'
require 'webmock/rspec'
require 'workos'
require 'vcr'

# Support
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }

SPEC_ROOT = File.dirname __FILE__

VCR.configure do |config|
  config.cassette_library_dir = 'spec/support/fixtures/vcr_cassettes'
  config.filter_sensitive_data('<API_KEY>') { WorkOS.config.key }
  config.filter_sensitive_data('<ACCESS_TOKEN>', :token) do |interaction|
    JSON.parse(interaction.response.body)['access_token']
  end
  config.filter_sensitive_data('<REFRESH_TOKEN>', :token) do |interaction|
    JSON.parse(interaction.response.body)['refresh_token']
  end
  config.hook_into :webmock
end

RSpec.configure do |config|
  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  config.shared_context_metadata_behavior = :apply_to_host_groups

  WebMock::API.prepend(Module.new do
    extend self

    # Disable VCR when a WebMock stub is created
    # for clearer spec failure messaging
    def stub_request(*args)
      VCR.turn_off!
      super
    end
  end)

  config.before(:all) { WorkOS.config.key ||= '' }
  config.before(:each) { VCR.turn_on! }
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
workos-5.9.0 spec/spec_helper.rb
workos-5.8.0 spec/spec_helper.rb
workos-5.7.0 spec/spec_helper.rb
workos-5.6.0 spec/spec_helper.rb
workos-5.5.1 spec/spec_helper.rb
workos-5.5.0 spec/spec_helper.rb
workos-5.4.0 spec/spec_helper.rb
workos-5.3.0 spec/spec_helper.rb
workos-5.2.1 spec/spec_helper.rb
workos-5.2.0 spec/spec_helper.rb
workos-5.1.0 spec/spec_helper.rb
workos-5.0.0 spec/spec_helper.rb
workos-4.8.0 spec/spec_helper.rb
workos-4.5.0 spec/spec_helper.rb
workos-4.4.0 spec/spec_helper.rb
workos-4.3.0 spec/spec_helper.rb
workos-4.2.1 spec/spec_helper.rb
workos-4.2.0 spec/spec_helper.rb