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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTM4ZGM3ZDAwMTViOTY2MDc2YzQzMDgwNDlhYTM0MTdmN2NmZjkxNQ==
4
+ NWFkYjk0YWUzNjBiNjhlZDQyNjE1YTgxY2VjMTNjODdhODMxZDk5Nw==
5
5
  data.tar.gz: !binary |-
6
- YzZjMzkwNzU4NmU2NjEzMWMzMDQ0NTZiODVlN2NmYzJiZTdlMzVkZg==
6
+ NjUzOTIxZmMwNTM1MmVlZTRiNjBjZGU0NmQ5ZmE3OGYwYmFhNzE5Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2E3NzEwOThmYWJjNzkxY2YzMzJhZDFlZWY3NWFkMjM3ODFjNmRmMzRiZmE4
10
- MmZjZDY3N2RiZWRhZDlkODQ4MTRiZTFjOTM0YmFkYzFlMzZlY2VkMzJkYjY3
11
- MzY0MGU5ZjhjMzQ5NzhmNDU5ZGQyODUwOWFkZWQ0ZDlkMTVhNjc=
9
+ YjE1YmQyNzMyYWVhMDBmMTZhMjgxMjg0MmEwMDM0ZmEwMWIxMjhjMTZkODQx
10
+ NDhiNGQzY2RlN2MwOWNmMTNiMzY5ZDdhYWVmNmFkOTUxZjMxZTkyN2UyZjU0
11
+ NGQzZjAyODNkZDE0ZGU3YmI3ZjYwMjk0ZDA5OWJhN2FiMDljYzY=
12
12
  data.tar.gz: !binary |-
13
- MzZkNmUyMzUzNDE4NjA3MDMxMWUxOGM3ZGUwMDlhZjMwOGQ3Mzc0YjhiOWM4
14
- MzRhMzhhYjc1YTZkOWI4MzQwMjc5OTkzM2ZiOTk4ZmI1ZGU4YWIxODkyNTQ2
15
- Y2ZhNDg5ODVkMTM3MmNmNDZlMzI2MGIyZjEyNzFkYTYzYWNmOTM=
13
+ YjJmMzkwNjZiNjhhMzk1ODFlOTFmYTcxYmRjMmQ1NWQ4NDcyNDc5YWM1NThl
14
+ OWJlZjVlNjBjNWEyZjQ2M2RiMWViZjg2OTIzNWMyYWY1ZTZlNTUxNThmMmEz
15
+ OTZjYzQ5ZDRjMzc4YjhlYmNjZDMwNGNkYTEyYjgzNTc4YzFhOTA=
data/.gitignore CHANGED
@@ -16,3 +16,5 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .rvmrc
19
+ .ruby-gemset
20
+ .ruby-version
@@ -26,8 +26,7 @@ module CurrencyConverter
26
26
  validate_currency
27
27
  ex_rate = exchange_rate
28
28
  validate_rate(ex_rate)
29
- value = "%.2f" % (ex_rate.to_f * fixnum).to_s
30
- value.to_f
29
+ ex_rate.to_f * fixnum
31
30
  end
32
31
 
33
32
  private
@@ -1,3 +1,3 @@
1
1
  module CurrencyConverter
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -2,20 +2,21 @@ require "spec_helper"
2
2
 
3
3
  describe CurrencyConverter do
4
4
  describe ".exchange" do
5
- it "should return the correct rate" do
6
- CurrencyConverter.exchange("USD", "USD", 1).should == 1.0
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 'should raise an error on an unsupported currency code' do
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 'should not raise an error for supported currency codes' do
18
- expect { CurrencyConverter.exchange("EUR", "USD", 100) }.not_to raise_error(CurrencyConverter::UnknownCurrency)
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.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: 2014-03-25 00:00:00.000000000 Z
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.2.0
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