Sha256: 3309360e7a3dc475e4225192eda1850cd1124a23faa56fa5391ff097641e4d0d

Contents?: true

Size: 661 Bytes

Versions: 1

Compression:

Stored size: 661 Bytes

Contents

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

module Stripe
  class StripeObjectTest < Test::Unit::TestCase
    should "implement #respond_to correctly" do
      obj = Stripe::StripeObject.construct_from({ :id => 1, :foo => 'bar' })
      assert obj.respond_to?(:id)
      assert obj.respond_to?(:foo)
      assert !obj.respond_to?(:baz)
    end

    should "marshal a stripe object correctly" do
      obj = Stripe::StripeObject.construct_from({ :id => 1, :name => 'Stripe' }, 'apikey')
      m = Marshal.load(Marshal.dump(obj))
      assert_equal m.id, 1
      assert_equal m.name, 'Stripe'
      assert_equal m.api_key, 'apikey'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stripe-1.10.1 test/stripe/stripe_object_test.rb