Sha256: 469499e4df218d222c17e872027ec88789e97c3b053cb712b652995830ed7a68

Contents?: true

Size: 649 Bytes

Versions: 11

Compression:

Stored size: 649 Bytes

Contents

# -*- encoding: utf-8 -*-
require 'spec_helper'
require 'money'

Money.default_currency = 'EUR'

module HappyHelpers
  module Helpers
    describe Numbers do
      describe "#currency" do
        include Numbers

        it "formats the given numerical value as a currency string" do
          currency(1).should == "€1,00"
          currency(1234.567).should == "€1.234,57"
        end

        it "also accept string values" do
          currency("EUR 12,99").should == '€12,99'
        end

        it "knows how to deal with negative values" do
          currency(-1234.56).should == '€-1.234,56'
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
happy-helpers-0.1.0.pre15 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre14 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre13 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre12 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre11 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre10 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre9 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre8 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre7 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre6 spec/helpers/numbers_spec.rb
happy-helpers-0.1.0.pre.6 spec/helpers/numbers_spec.rb