currency_converter 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.gitignore +2 -0
- data/lib/currency_converter.rb +1 -2
- data/lib/currency_converter/version.rb +1 -1
- data/spec/currency_converter_spec.rb +6 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWFkYjk0YWUzNjBiNjhlZDQyNjE1YTgxY2VjMTNjODdhODMxZDk5Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjUzOTIxZmMwNTM1MmVlZTRiNjBjZGU0NmQ5ZmE3OGYwYmFhNzE5Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjE1YmQyNzMyYWVhMDBmMTZhMjgxMjg0MmEwMDM0ZmEwMWIxMjhjMTZkODQx
|
10
|
+
NDhiNGQzY2RlN2MwOWNmMTNiMzY5ZDdhYWVmNmFkOTUxZjMxZTkyN2UyZjU0
|
11
|
+
NGQzZjAyODNkZDE0ZGU3YmI3ZjYwMjk0ZDA5OWJhN2FiMDljYzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjJmMzkwNjZiNjhhMzk1ODFlOTFmYTcxYmRjMmQ1NWQ4NDcyNDc5YWM1NThl
|
14
|
+
OWJlZjVlNjBjNWEyZjQ2M2RiMWViZjg2OTIzNWMyYWY1ZTZlNTUxNThmMmEz
|
15
|
+
OTZjYzQ5ZDRjMzc4YjhlYmNjZDMwNGNkYTEyYjgzNTc4YzFhOTA=
|
data/.gitignore
CHANGED
data/lib/currency_converter.rb
CHANGED
@@ -2,20 +2,21 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe CurrencyConverter do
|
4
4
|
describe ".exchange" do
|
5
|
-
it "
|
6
|
-
CurrencyConverter.exchange("USD", "USD", 1).
|
5
|
+
it "returns the correct rate" do
|
6
|
+
expect(CurrencyConverter.exchange("USD", "USD", 1)).to eq 1
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
describe "#validate_currency" do
|
11
11
|
describe CurrencyConverter::UnknownCurrency do
|
12
|
-
it '
|
12
|
+
it 'raise an error on an unsupported currency code' do
|
13
13
|
expect { CurrencyConverter.exchange("EUR", "UNKNOWN", 100) }.to raise_error(CurrencyConverter::UnknownCurrency)
|
14
14
|
expect { CurrencyConverter.exchange("UNKNOWN", "EUR", 100) }.to raise_error(CurrencyConverter::UnknownCurrency)
|
15
15
|
end
|
16
16
|
|
17
|
-
it '
|
18
|
-
expect { CurrencyConverter.exchange("EUR", "USD", 100) }.not_to raise_error
|
17
|
+
it 'doesn\'t raise an error for supported currency codes' do
|
18
|
+
expect { CurrencyConverter.exchange("EUR", "USD", 100) }.not_to raise_error
|
19
|
+
#expect { CurrencyConverter.exchange("EUR", "USD", 100) }.not_to raise_error(CurrencyConverter::UnknownCurrency)
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: currency_converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diganta Mandal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.4.8
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Google provides a web site to converts currencies using exchange rates but
|