Sha256: dd57138a83e653b2cd605e2ef33473a2954aaba263673795a098ab0b6e69babf
Contents?: true
Size: 936 Bytes
Versions: 56
Compression:
Stored size: 936 Bytes
Contents
require 'spec_helper.rb' describe Paypal::Payment::Common::Amount do let :keys do Paypal::Payment::Common::Amount.optional_attributes end describe '.new' do it 'should not allow nil for attributes' do amount = Paypal::Payment::Common::Amount.new keys.each do |key| amount.send(key).should == 0 end end it 'should treat all attributes as Numeric' do # Integer attributes = keys.inject({}) do |attributes, key| attributes.merge!(key => "100") end amount = Paypal::Payment::Common::Amount.new attributes keys.each do |key| amount.send(key).should == 100 end # Float attributes = keys.inject({}) do |attributes, key| attributes.merge!(key => "10.25") end amount = Paypal::Payment::Common::Amount.new attributes keys.each do |key| amount.send(key).should == 10.25 end end end end
Version data entries
56 entries across 56 versions & 3 rubygems