Sha256: 23335eea2cf2e64904588fced5c3bf1243d2507ee017cb2640f20459c454a9d6

Contents?: true

Size: 879 Bytes

Versions: 9

Compression:

Stored size: 879 Bytes

Contents

require_relative '../spec_helper'

describe Aptible::Billing do
  subject { Aptible::Billing::BillingDetail.new }

  it 'should have a configurable root_url' do
    config = described_class.configuration
    expect(config).to be_a GemConfig::Configuration
    expect(config.root_url).to eq 'https://billing.aptible.com'
  end

  # Not sure why this test is failing
  pending 'uses ENV["APTIBLE_BILLING_ROOT_URL"] if defined' do
    config = described_class.configuration
    set_env 'APTIBLE_BILLING_ROOT_URL', 'http://foobar.com' do
      config.reset
      expect(config.root_url).to eq 'http://foobar.com'
    end
  end

  it 'should be able to override root_url programatically' do
    config = described_class.configuration
    Aptible::Billing.configure do |c|
      c.root_url = 'http://foobar.com'
    end

    expect(config.root_url).to eq 'http://foobar.com'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
aptible-billing-1.0.1 spec/aptible/billing_spec.rb
aptible-billing-1.0.0 spec/aptible/billing_spec.rb
aptible-billing-0.1.7 spec/aptible/billing_spec.rb
aptible-billing-0.1.6 spec/aptible/billing_spec.rb
aptible-billing-0.1.5 spec/aptible/billing_spec.rb
aptible-billing-0.1.4 spec/aptible/billing_spec.rb
aptible-billing-0.1.3 spec/aptible/billing_spec.rb
aptible-billing-0.1.2 spec/aptible/billing_spec.rb
aptible-billing-0.1.1 spec/aptible/billing_spec.rb