bancard 0.0.1 → 0.0.2
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 +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/bancard.rb +5 -5
- data/lib/bancard/version.rb +1 -1
- data/spec/lib/bancard_spec.rb +9 -9
- data/spec/spec_helper.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f13b1d6e7668299a1c551c13d6fac23430b96ce1
|
4
|
+
data.tar.gz: 7ce02e1a003c4b257522a4570732f96029b357c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3ac36cc9118564834570421a9582ace87f8a0faaf9085c1fdaef7b02a18247127ed0be4823bf259dcf7b0c0a1084c76b662f94d065710385e0a2f01e5856e4f
|
7
|
+
data.tar.gz: 69a08d4849ce13aad0e9a6323f389611809ce37ba7f6fd1df893782642c024baa7b2415a156400bcad13f991f3b01e23861a0e25365e92d034ec0f2e0bb230ca
|
data/CHANGELOG.md
ADDED
data/lib/bancard.rb
CHANGED
@@ -14,16 +14,16 @@ module Bancard
|
|
14
14
|
|
15
15
|
DEFAULT_CURRENCY = 'PYG'
|
16
16
|
|
17
|
-
def self.
|
18
|
-
@
|
17
|
+
def self.sandbox!
|
18
|
+
@sandbox = true
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.
|
22
|
-
!!@
|
21
|
+
def self.sandbox?
|
22
|
+
!!@sandbox
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.vpos_url(path = nil)
|
26
|
-
uri = URI.parse(
|
26
|
+
uri = URI.parse(sandbox? ? TEST_URL : LIVE_URL)
|
27
27
|
uri.path = path.to_s
|
28
28
|
uri.to_s
|
29
29
|
end
|
data/lib/bancard/version.rb
CHANGED
data/spec/lib/bancard_spec.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Bancard do
|
4
|
-
describe '.
|
4
|
+
describe '.sandbox?' do
|
5
5
|
it 'returns false if nothing was set' do
|
6
|
-
Bancard.
|
7
|
-
expect(Bancard).not_to
|
6
|
+
Bancard.instance_variable_set(:@sandbox, nil)
|
7
|
+
expect(Bancard).not_to be_sandbox
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'returns true if set to true' do
|
11
|
-
Bancard.
|
12
|
-
expect(Bancard).to
|
11
|
+
Bancard.instance_variable_set(:@sandbox, true)
|
12
|
+
expect(Bancard).to be_sandbox
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'returns false if set to false' do
|
16
|
-
Bancard.
|
17
|
-
expect(Bancard).not_to
|
16
|
+
Bancard.instance_variable_set(:@sandbox, false)
|
17
|
+
expect(Bancard).not_to be_sandbox
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
describe '.vpos_url' do
|
22
|
-
it 'returns the correct vpos_url for
|
22
|
+
it 'returns the correct vpos_url for sandbox' do
|
23
23
|
expect(Bancard.vpos_url).to eq 'https://vpos.infonet.com.py:8888'
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'returns the correct vpos_url for live' do
|
27
|
-
Bancard.
|
27
|
+
Bancard.instance_variable_set(:@sandbox, false)
|
28
28
|
expect(Bancard.vpos_url).to eq 'https://vpos.infonet.com.py'
|
29
29
|
end
|
30
30
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'simplecov'
|
2
2
|
require 'byebug'
|
3
3
|
|
4
|
-
SimpleCov.
|
4
|
+
SimpleCov.profiles.define 'gem' do
|
5
5
|
add_filter '/spec/'
|
6
6
|
add_filter '/autotest/'
|
7
7
|
add_group 'Libraries', '/lib/'
|
@@ -12,7 +12,7 @@ require 'bancard'
|
|
12
12
|
|
13
13
|
RSpec.configure do |config|
|
14
14
|
config.before do
|
15
|
-
Bancard.
|
15
|
+
Bancard.sandbox!
|
16
16
|
end
|
17
17
|
|
18
18
|
config.before(:all) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bancard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- betterplace developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- ".rspec"
|
106
106
|
- ".ruby-version"
|
107
107
|
- ".travis.yml"
|
108
|
+
- CHANGELOG.md
|
108
109
|
- Gemfile
|
109
110
|
- LICENSE
|
110
111
|
- README.md
|