test/stripe/stripe_object_test.rb in stripe-1.18.0 vs test/stripe/stripe_object_test.rb in stripe-1.19.0
- old
+ new
@@ -8,14 +8,15 @@
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')
+ obj = Stripe::StripeObject.construct_from({ :id => 1, :name => 'Stripe' }, {:api_key => 'apikey'})
m = Marshal.load(Marshal.dump(obj))
assert_equal 1, m.id
assert_equal 'Stripe', m.name
- assert_equal 'apikey', m.api_key
+ expected_hash = {:api_key => 'apikey'}
+ assert_equal expected_hash, m.instance_variable_get('@opts')
end
should "recursively call to_hash on its values" do
nested = Stripe::StripeObject.construct_from({ :id => 7, :foo => 'bar' })
obj = Stripe::StripeObject.construct_from({ :id => 1, :nested => nested })