Sha256: 30d3070a438cf2f593991eaa1eed94b3266a570c0e175a7d4d6bdfc752afaed3

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

def setup_client_qa_support(*clients, keyed: false)
  clients.each do |client|
    key = client.config.root_key

    qa_support "#{key}_helpers"
    helpers_module  = Object.const_get("QA::#{client.base_module.name.split('::').last}Helpers")
    env_key         = "#{key}_qa".upcase

    RSpec.configure do |config|
      if keyed
        config.include helpers_module, qa: true, client: key
      else
        config.include helpers_module, qa: true
      end

      config.around(:each, qa: true) do |example|
        if ENV.fetch(env_key, nil) == '1'
          example.run
        else
          skip "Set #{env_key}=1 to run #{key} QA tests"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ledger_sync-1.5.2 lib/ledger_sync/test/support/qa/ledger_support_setup.rb