Sha256: fd8275c1c6bf38e07510b1facc55460e467fadb15c0f184f76a2f8173e652104

Contents?: true

Size: 718 Bytes

Versions: 10

Compression:

Stored size: 718 Bytes

Contents

require 'spec_helper'

module Beatport 
  describe Price do
    subject :price do
      Price.new({"code" => "usd", "symbol" => "$", "value" => 1490})
    end

    describe 'defaults' do
      it "should have the same rounding_mode" do
        Price.rounding_mode.should eq(Money.rounding_mode)
      end
      
      it "should have the same precision" do
        Price.conversion_precision.should eq(Money.conversion_precision)
      end
      
    end
    
    describe '#to_s' do
      it "can be converted to a string" do
        price.to_s.should eq('14.90')
      end

      it "is equivalent to a given money object" do
        price.to_s.should eq(Money.new(1490, 'usd').to_s)
      end
    end
  end
end
    

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
beatport-0.4.0 spec/price_spec.rb
beatport-0.3.0 spec/price_spec.rb
beatport-0.2.3 spec/price_spec.rb
beatport-0.2.2 spec/price_spec.rb
beatport-0.2.1 spec/price_spec.rb
beatport-0.2.0 spec/price_spec.rb
beatport-0.1.10 spec/price_spec.rb
beatport-0.1.9 spec/price_spec.rb
beatport-0.1.8 spec/price_spec.rb
beatport-0.1.7 spec/price_spec.rb