flow-reference 0.2.85

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.
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Flow::Reference::Currencies do
4
+
5
+ it 'checks loading of currency model' do
6
+ currency_class = ::Io::Flow::Reference::V0::Models::Currency
7
+
8
+ expect(Flow::Reference::Currencies.find('usd').class).to eq(currency_class)
9
+ expect(Flow::Reference::Currencies.find(' usd ').class).to eq(currency_class)
10
+ expect(Flow::Reference::Currencies.find('USD').class).to eq(currency_class)
11
+ expect(Flow::Reference::Currencies.find('JPY').class).to eq(currency_class)
12
+
13
+ expect(Flow::Reference::Currencies.find('other')).to be_nil
14
+ end
15
+
16
+ it 'checks to_cents conversion' do
17
+ expect(Flow::Reference::Currencies::Data.Usd.to_cents("10.52")).to eq(1052)
18
+ expect(Flow::Reference::Currencies::Data.Usd.to_cents("10.524")).to eq(1052)
19
+ expect(Flow::Reference::Currencies::Data.Usd.to_cents("10.525")).to eq(1053)
20
+ expect(Flow::Reference::Currencies::Data.Cad.to_cents("10.525")).to eq(1053)
21
+ expect(Flow::Reference::Currencies::Data.Usd.to_cents(100)).to eq(10000)
22
+ expect(Flow::Reference::Currencies::Data.Mro.to_cents("105")).to eq(1050)
23
+ expect(Flow::Reference::Currencies::Data.Mro.to_cents("105.55")).to eq(1056)
24
+
25
+ # Japan Jen has no cents
26
+ expect(Flow::Reference::Currencies::Data.Jpy.to_cents("105")).to eq(105)
27
+ expect(Flow::Reference::Currencies::Data.Jpy.to_cents(105)).to eq(105)
28
+ expect(Flow::Reference::Currencies.find('JPY').to_cents(105)).to eq(105)
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ require './lib/flow-reference.rb'
2
+
3
+ RSpec.configure do |config|
4
+ config.color = true
5
+ config.tty = true
6
+ config.formatter = :documentation
7
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flow-reference
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.85
5
+ platform: ruby
6
+ authors:
7
+ - Michael Bryzek
8
+ - Dino Reic
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2017-03-31 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Flow helper libraries for working with https://api.flow.io
15
+ email: mbryzek@alum.mit.edu
16
+ executables:
17
+ - build-currency.rb
18
+ - download.bash
19
+ - generate.bash
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - ".apidoc"
24
+ - ".gitignore"
25
+ - Gemfile
26
+ - Gemfile.lock
27
+ - LICENSE
28
+ - README.md
29
+ - bin/build-currency.rb
30
+ - bin/download.bash
31
+ - bin/generate.bash
32
+ - data/continents.json
33
+ - data/countries.json
34
+ - data/currencies.json
35
+ - data/languages.json
36
+ - data/locales.json
37
+ - data/payment-methods.json
38
+ - data/regions.json
39
+ - flow-reference.gemspec
40
+ - lib/flow-reference.rb
41
+ - lib/generated/currencies.rb
42
+ - lib/io_flow_reference_v0.rb
43
+ - spec/common/basic_spec.rb
44
+ - spec/spec_helper.rb
45
+ homepage: https://www.flow.io
46
+ licenses:
47
+ - MIT
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 2.6.10
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: Flow helpers
69
+ test_files:
70
+ - spec/common/basic_spec.rb
71
+ - spec/spec_helper.rb