Sha256: c0623e99a73a41daa57be80ac822f91606ac8b43306aaa69313e14c59aa8a86e

Contents?: true

Size: 482 Bytes

Versions: 2

Compression:

Stored size: 482 Bytes

Contents

module Danconia
  describe Serializable do
    context 'marshalling' do
      it 'money objects support dump and load' do
        expect(Marshal.load(Marshal.dump(Money(5, 'USD')))).to eq Money(5, 'USD')
        expect(Marshal.load(Marshal.dump(Money(3.2, 'ARS')))).to eq Money(3.2, 'ARS')
      end
    end

    context 'to_json' do
      it 'should delegate to the amount' do
        expect(Money(1).to_json).to eq %({"amount":"1.0","currency":"USD"})
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
danconia-0.4.0 spec/danconia/serializable_spec.rb
danconia-0.3.1 spec/danconia/serializable_spec.rb