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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1e7c61665f065ed2b22b7b55840cbbd2cf8539b
4
- data.tar.gz: dd1879934325b5206d67a00de226b5e6ceb1acd3
3
+ metadata.gz: f13b1d6e7668299a1c551c13d6fac23430b96ce1
4
+ data.tar.gz: 7ce02e1a003c4b257522a4570732f96029b357c2
5
5
  SHA512:
6
- metadata.gz: b48940f65a93092cd9325afa74ff9248aad6544ffa827f89812997a0598eedab90c17e91f69dba350453b86b04b4d438d2a1cd1d71eb252ea03efa56a86f5dfa
7
- data.tar.gz: 6a978b78d6c49bffc97968827d53eadb45155f99d8994a0398a6eaf82417fbe37d2ded4197ddd3bd5f63ae158d8dd085c1cc49b0d8170a824c615df3c9e26f27
6
+ metadata.gz: a3ac36cc9118564834570421a9582ace87f8a0faaf9085c1fdaef7b02a18247127ed0be4823bf259dcf7b0c0a1084c76b662f94d065710385e0a2f01e5856e4f
7
+ data.tar.gz: 69a08d4849ce13aad0e9a6323f389611809ce37ba7f6fd1df893782642c024baa7b2415a156400bcad13f991f3b01e23861a0e25365e92d034ec0f2e0bb230ca
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ # 2014-11-19 - 0.0.2
2
+ - Rename `Bancard.test=` to `Bancard.sandbox!`
data/lib/bancard.rb CHANGED
@@ -14,16 +14,16 @@ module Bancard
14
14
 
15
15
  DEFAULT_CURRENCY = 'PYG'
16
16
 
17
- def self.test=(value)
18
- @test = !!value
17
+ def self.sandbox!
18
+ @sandbox = true
19
19
  end
20
20
 
21
- def self.test?
22
- !!@test
21
+ def self.sandbox?
22
+ !!@sandbox
23
23
  end
24
24
 
25
25
  def self.vpos_url(path = nil)
26
- uri = URI.parse(test? ? TEST_URL : LIVE_URL)
26
+ uri = URI.parse(sandbox? ? TEST_URL : LIVE_URL)
27
27
  uri.path = path.to_s
28
28
  uri.to_s
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module Bancard
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,30 +1,30 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Bancard do
4
- describe '.test?' do
4
+ describe '.sandbox?' do
5
5
  it 'returns false if nothing was set' do
6
- Bancard.test = nil
7
- expect(Bancard).not_to be_test
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.test = true
12
- expect(Bancard).to be_test
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.test = false
17
- expect(Bancard).not_to be_test
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 test' do
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.test = false
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.adapters.define 'gem' do
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.test = true
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.1
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-14 00:00:00.000000000 Z
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