test/stripe/stripe_object_test.rb in stripe-2.0.2 vs test/stripe/stripe_object_test.rb in stripe-2.0.3
- old
+ new
@@ -34,10 +34,18 @@
assert_equal 1, obj[:id]
assert_equal 'Stripe', obj[:name]
end
should "marshal a stripe object correctly" do
- obj = Stripe::StripeObject.construct_from({ :id => 1, :name => 'Stripe' }, {:api_key => 'apikey'})
+ obj = Stripe::StripeObject.construct_from(
+ { :id => 1, :name => 'Stripe' },
+ {
+ :api_key => 'apikey',
+ # StripeClient is not serializable and is expected to be removed
+ # when marshalling StripeObjects
+ :client => StripeClient.active_client,
+ }
+ )
m = Marshal.load(Marshal.dump(obj))
assert_equal 1, m.id
assert_equal 'Stripe', m.name
expected_hash = {:api_key => 'apikey'}
assert_equal expected_hash, m.instance_variable_get('@opts')