more_money 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +2 -0
- data/lib/more_money/core_extensions.rb +1 -1
- data/lib/more_money/more_money.rb +6 -0
- data/lib/more_money/version.rb +1 -1
- data/test/more_money_test.rb +9 -0
- metadata +2 -2
data/CHANGELOG.txt
CHANGED
@@ -113,6 +113,12 @@ module MoreMoney
|
|
113
113
|
raise MoneyInvalidCurrency, "#{currency} is not defined as a currency" unless CURRENCIES.key?(currency)
|
114
114
|
end
|
115
115
|
|
116
|
+
#returns the symbol for the given currency code
|
117
|
+
#
|
118
|
+
# MoreMoney::Money.curr_symbol('USD')
|
119
|
+
#
|
120
|
+
# => '$'
|
121
|
+
#
|
116
122
|
def self.curr_symbol(currency = Money.default_currency)
|
117
123
|
check_currency(currency)
|
118
124
|
CURRENCIES[currency][:symbol]
|
data/lib/more_money/version.rb
CHANGED
data/test/more_money_test.rb
CHANGED
@@ -85,6 +85,15 @@ class MoreMoneyTest < Test::Unit::TestCase
|
|
85
85
|
assert_equal 'USD', c.currency
|
86
86
|
end
|
87
87
|
|
88
|
+
def test_nil
|
89
|
+
a = ''.to_money
|
90
|
+
assert_equal nil, a.cents
|
91
|
+
a = '0'.to_money
|
92
|
+
assert_equal 0, a.cents
|
93
|
+
a = 'a'.to_money
|
94
|
+
assert_equal nil, a.cents
|
95
|
+
end
|
96
|
+
|
88
97
|
def test_symbol
|
89
98
|
assert_equal '$', Money.curr_symbol
|
90
99
|
assert_equal '£', Money.curr_symbol('GBP')
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.1
|
|
3
3
|
specification_version: 1
|
4
4
|
name: more_money
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.0.8
|
7
|
+
date: 2007-02-05 00:00:00 +00:00
|
8
8
|
summary: handles money objects in any currency using just integer as backend
|
9
9
|
require_paths:
|
10
10
|
- lib
|