Sha256: c627320e54fe34996b4ed6855a9a7cf856eb372ab83f5dfc39021cb1abe58323

Contents?: true

Size: 1.52 KB

Versions: 20

Compression:

Stored size: 1.52 KB

Contents

require File.expand_path("../test_helper", __FILE__)

class StripeTest < Test::Unit::TestCase
  should "warn that #refresh_from is deprecated" do
    old_stderr = $stderr
    $stderr = StringIO.new
    begin
      Stripe.uri_encode({})
      message = "NOTE: Stripe.uri_encode is deprecated; use " \
                "Stripe::Util#encode_parameters instead"
      assert_match Regexp.new(message), $stderr.string
    ensure
      $stderr = old_stderr
    end
  end

  should "allow app_info to be configured" do
    begin
      old = Stripe.app_info
      Stripe.set_app_info(
        "MyAwesomePlugin",
        url: "https://myawesomeplugin.info",
        version: "1.2.34"
      )
      assert_equal({
        name: "MyAwesomePlugin",
        url: "https://myawesomeplugin.info",
        version: "1.2.34",
      }, Stripe.app_info)
    ensure
      Stripe.app_info = old
    end
  end

  should "allow ca_bundle_path to be configured" do
    begin
      old = Stripe.ca_bundle_path
      Stripe.ca_bundle_path = "path/to/ca/bundle"
      assert_equal "path/to/ca/bundle", Stripe.ca_bundle_path
    ensure
      Stripe.ca_bundle_path = old
    end
  end

  should "allow max_network_retries to be configured" do
    begin
      old = Stripe.max_network_retries
      Stripe.max_network_retries = 99
      assert_equal 99, Stripe.max_network_retries
    ensure
      Stripe.max_network_retries = old
    end
  end

  should "have default open and read timeouts" do
    assert_equal Stripe.open_timeout, 30
    assert_equal Stripe.read_timeout, 80
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
stripe-3.14.0 test/stripe_test.rb
stripe-3.13.1 test/stripe_test.rb
stripe-3.13.0 test/stripe_test.rb
stripe-3.12.1 test/stripe_test.rb
stripe-3.12.0 test/stripe_test.rb
stripe-3.11.0 test/stripe_test.rb
stripe-3.10.0 test/stripe_test.rb
stripe-3.9.2 test/stripe_test.rb
stripe-3.9.1 test/stripe_test.rb
stripe-3.9.0 test/stripe_test.rb
stripe-3.8.2 test/stripe_test.rb
stripe-3.8.1 test/stripe_test.rb
stripe-3.8.0 test/stripe_test.rb
stripe-3.7.0 test/stripe_test.rb
stripe-3.6.0 test/stripe_test.rb
stripe-3.5.3 test/stripe_test.rb
stripe-3.5.2 test/stripe_test.rb
stripe-3.5.1 test/stripe_test.rb
stripe-3.5.0 test/stripe_test.rb
stripe-3.4.1 test/stripe_test.rb