money-open-exchange-rates 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca0a9252d989a1593a4dc9af24c8789f17eb9ec15cc2e0bfa09b2d44c719e8b1
|
4
|
+
data.tar.gz: d45842e216378fb1dd04d477b1c203482f955d9607397eb570c0612606211ce8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c69afba4a53c236836ea72c27e4e095c48cc09fb95584e14f9912e6e7c0de43fedf03204e1a62a56558d054b83bc32b18ddc1cbbff8a2672917765e9774d136a
|
7
|
+
data.tar.gz: 97fc884e5e97ab688d7d6480a88540e5a308c1d838b85ad0c19c63c41b6f73230f92b000ed09daa618727a4bd2a22e714b1006966339545013d956da749e6b50
|
data/History.md
CHANGED
@@ -326,7 +326,7 @@ class Money
|
|
326
326
|
from_base_rate = get_rate_or_calc_inverse(source, from_currency, opts)
|
327
327
|
to_base_rate = get_rate_or_calc_inverse(source, to_currency, opts)
|
328
328
|
if to_base_rate && from_base_rate
|
329
|
-
rate = BigDecimal(to_base_rate) / from_base_rate
|
329
|
+
rate = BigDecimal(to_base_rate.to_s) / from_base_rate
|
330
330
|
add_rate(from_currency, to_currency, rate)
|
331
331
|
return rate
|
332
332
|
end
|
@@ -63,6 +63,11 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
63
63
|
subject.exchange_with(money, 'BMD').must_equal Money.new(50, 'BMD')
|
64
64
|
end
|
65
65
|
|
66
|
+
it 'should be able to handle non integer rates' do
|
67
|
+
money = Money.new(100, 'BBD')
|
68
|
+
subject.exchange_with(money, 'TJS').must_equal Money.new(250, 'TJS')
|
69
|
+
end
|
70
|
+
|
66
71
|
it "should raise if it can't find an exchange rate" do
|
67
72
|
money = Money.new(0, 'USD')
|
68
73
|
proc { subject.exchange_with(money, 'SSP') }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money-open-exchange-rates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent Arnoud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: money
|