boa_vista 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZDZhNTFlNGFhMThkYzVjOThlM2NkZjY0ZTdmZDQ1ZjcyNDljYTNiZA==
5
- data.tar.gz: !binary |-
6
- ZjkyYmI3N2YwOTgxYWRmYjZmODk0YTFmYTQ5ZGM4YzY4OWQ5MTg0OA==
2
+ SHA1:
3
+ metadata.gz: 886a46d623b2bc56ae20f9f98ef31574b57719e6
4
+ data.tar.gz: e60184293581b8910692a3a631c838cdcb43ef30
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NzRkYzZiMWE2Y2IyNzAzOTQ3ODNiMjEzNDY2YTMwZTEyZGY4OTFlMDkwODZj
10
- NzJjZWYyY2E1NWE3YWVmYzVlZTUxN2NiNGE5YTY1MDAzOTUyZjNmMWEwZmE3
11
- OThhMDEyNjdjODQ4ZmFiOGViNDgwZDZlYzljZmYyY2IwN2U5MDI=
12
- data.tar.gz: !binary |-
13
- YTIxYmExNGM3MzdhMGExMTZkN2M3ZDAwOTNiYmU0OGMyZjZlNTdlODYwNGY1
14
- Njg3MWQ0ZWFiNGE3NDA0ODM4NDMzOTBiYTI2ZDMxMjJmZWU3NDBjZDhmNDIx
15
- NzkxNjZlOTkzMDY0M2U0MjMwOWJlYTk1NjQxMDVmMmRhODRkOTM=
6
+ metadata.gz: 6edb8b8c0aa843c2536e6344830376f7eb89f0ceec0d69d7e355aabf0a0cb43d065c5b0ef800bf66b3fb9bc414e345f55be4bf2512263da87e280a8d6e2b6dc3
7
+ data.tar.gz: dca51e4c37384fabc726d26a244c469123b6f6e2f3333067bf53442cf36b42fa4b2fd919327beac141e5587c14ace2c119044a702990d64833d1cf35bb6a8175
@@ -3,5 +3,6 @@ module BoaVista
3
3
  class Timeout < StandardError; end
4
4
  class InvalidLayout < StandardError; end
5
5
  class FileNotExists < StandardError; end
6
+ class InvalidDocumentType < StandardError; end
6
7
  end
7
8
  end
@@ -20,7 +20,7 @@ module BoaVista
20
20
  when DOCUMENT_TYPE[:cpf] then BoaVista::Request::Layout::Cpf
21
21
  when DOCUMENT_TYPE[:cnpj] then BoaVista::Request::Layout::Cnpj
22
22
  else
23
- fail 'Invalid document type'
23
+ fail BoaVista::Errors::InvalidDocumentType.new("Invalid document type: #{@values[:document_type]}")
24
24
  end
25
25
  end
26
26
 
@@ -1,3 +1,3 @@
1
1
  module BoaVista
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -1 +1 @@
1
- TTTTTTTTVVRRRRRRRRRRBBBBBBBBBBBBBBBBBBBBCCCCCCCCQQQQQQQQQVYCNNNNNNNTTTTZZZPPPS57487067000110RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCUU
1
+ TTTTTTTTVVRRRRRRRRRRBBBBBBBBBBBBBBBBBBBBCCCCCCCCQQQQQQQQQVYCNNNNNNNTTTTZZZ138S57487067000110RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCUU
@@ -1 +1 @@
1
- TTTTTTTTVVRRRRRRRRRRBBBBBBBBBBBBBBBBBBBBCCCCCCCCQQQQQQQQQVYCNNNNNNNTTTTZZZPPPRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN3073086661025121982MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMVVVVVVVVVVVVV
1
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RBBBBBBBBBBBBBBBBBBBBCCCCCCCCQQQQQQQQQVYCNNNNNNNTTTTZZZPPPSYMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
1
+ TTTTTTTTVVRRRRRRRRRRBBBBBBBBBBBBBBBBBBBBCCCCCCCCQQQQQQQQQVYCNNNNNNNTTTTZZZ901SYMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
@@ -38,6 +38,6 @@ RSpec.describe BoaVista::Request do
38
38
  let(:values) { Hash.new }
39
39
  let(:document_type) { '3' }
40
40
 
41
- it { expect { subject }.to raise_error }
41
+ it { expect { subject }.to raise_error(BoaVista::Errors::InvalidDocumentType) }
42
42
  end
43
43
  end
@@ -12,5 +12,8 @@ RSpec.describe BoaVista::Response::Layout::Layout138 do
12
12
  its(:company_name) { is_expected.to eq('R' * 115) }
13
13
  its(:city) { is_expected.to eq('C' * 40) }
14
14
  its(:uf) { is_expected.to eq('U' * 2) }
15
+
16
+ its(:record_type) { is_expected.to eq('138') }
17
+ its(:valid_record?) { is_expected.to eq(true)}
15
18
  end
16
19
  end
@@ -7,11 +7,13 @@ RSpec.describe BoaVista::Response::Layout::Layout221 do
7
7
  subject { instance.read }
8
8
 
9
9
  its(:transaction) { is_expected.to eq('T' * 8) }
10
- its(:record) { is_expected.to eq('R') }
11
10
  its(:name) { is_expected.to eq('N' * 50) }
12
11
  its(:document) { is_expected.to eq('30730866610') }
13
12
  its(:birthday_date) { is_expected.to eq('25121982') }
14
13
  its(:mothers_name) { is_expected.to eq('M' * 50) }
15
14
  its(:voter_registration) { is_expected.to eq('V' * 13) }
15
+
16
+ its(:record_type) { is_expected.to eq('221') }
17
+ its(:valid_record?) { is_expected.to eq(true) }
16
18
  end
17
19
  end
@@ -12,5 +12,8 @@ RSpec.describe BoaVista::Response::Layout::Layout282 do
12
12
  its(:company_name) { is_expected.to eq('C' * 50) }
13
13
  its(:document_type) { is_expected.to eq('T') }
14
14
  its(:document_number) { is_expected.to eq('57487067000110') }
15
+
16
+ its(:record_type) { is_expected.to eq('282') }
17
+ its(:valid_record?) { is_expected.to eq(true) }
15
18
  end
16
19
  end
@@ -18,5 +18,8 @@ RSpec.describe BoaVista::Response::Layout::Layout283 do
18
18
  its(:function) { is_expected.to eq('F' * 20) }
19
19
  its(:signs) { is_expected.to eq('S') }
20
20
  its(:percentage) { is_expected.to eq('G' * 5) }
21
+
22
+ its(:record_type) { is_expected.to eq('283') }
23
+ its(:valid_record?) { is_expected.to eq(true) }
21
24
  end
22
25
  end
@@ -10,5 +10,9 @@ RSpec.describe BoaVista::Response::Layout::Layout285 do
10
10
  its(:record) { is_expected.to eq('S') }
11
11
  its(:hive_activity_code) { is_expected.to eq('H' * 8) }
12
12
  its(:hive_activity_description) { is_expected.to eq('D' * 55) }
13
+
14
+
15
+ its(:record_type) { is_expected.to eq('285') }
16
+ its(:valid_record?) { is_expected.to eq(true) }
13
17
  end
14
18
  end
@@ -28,5 +28,8 @@ RSpec.describe BoaVista::Response::Layout::Layout353 do
28
28
  its(:segment) { is_expected.to eq('S' * 79) }
29
29
  its(:hive_activity_code) { is_expected.to eq('R' * 8) }
30
30
  its(:hive_activity_description) { is_expected.to eq('D' * 55) }
31
+
32
+ its(:record_type) { is_expected.to eq('353') }
33
+ its(:valid_record?) { is_expected.to eq(true) }
31
34
  end
32
35
  end
@@ -17,5 +17,8 @@ RSpec.describe BoaVista::Response::Layout::Layout354 do
17
17
  its(:value_current_capital) { is_expected.to eq('V' * 15) }
18
18
  its(:current_organ) { is_expected.to eq('O' * 8) }
19
19
  its(:change_date) { is_expected.to eq('D' * 8) }
20
+
21
+ its(:record_type) { is_expected.to eq('354') }
22
+ its(:valid_record?) { is_expected.to eq(true) }
20
23
  end
21
24
  end
@@ -10,5 +10,9 @@ RSpec.describe BoaVista::Response::Layout::Layout901 do
10
10
  its(:record) { is_expected.to eq('S') }
11
11
  its(:message_type) { is_expected.to eq('Y') }
12
12
  its(:message) { is_expected.to eq('M' * 130) }
13
+
14
+
15
+ its(:record_type) { is_expected.to eq('901') }
16
+ its(:valid_record?) { is_expected.to eq(true) }
13
17
  end
14
18
  end
@@ -8,5 +8,7 @@ RSpec.describe BoaVista::Response::Layout::Layout999 do
8
8
 
9
9
  its(:transaction) { is_expected.to eq('T' * 8) }
10
10
  its(:record) { is_expected.to eq('S' * 95) }
11
+
12
+ its(:record_type) { is_expected.to eq('999') }
11
13
  end
12
14
  end
@@ -1,3 +1,3 @@
1
1
  RSpec.describe BoaVista::VERSION do
2
- specify { expect(BoaVista::VERSION).to eq '0.0.3' }
2
+ specify { expect(BoaVista::VERSION).to eq '0.0.4' }
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boa_vista
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Souza
@@ -9,90 +9,90 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-10 00:00:00.000000000 Z
12
+ date: 2016-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: codeclimate-test-reporter
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ! '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ! '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: webmock
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ! '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ! '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ! '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ! '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec-its
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ! '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ! '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: rake
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ! '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ! '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  description: Client for Boa Vista
@@ -184,17 +184,17 @@ require_paths:
184
184
  - lib
185
185
  required_ruby_version: !ruby/object:Gem::Requirement
186
186
  requirements:
187
- - - ! '>='
187
+ - - ">="
188
188
  - !ruby/object:Gem::Version
189
189
  version: '0'
190
190
  required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ! '>='
192
+ - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  requirements: []
196
196
  rubyforge_project:
197
- rubygems_version: 2.4.8
197
+ rubygems_version: 2.4.6
198
198
  signing_key:
199
199
  specification_version: 4
200
200
  summary: Client for Boa Vista
@@ -241,3 +241,4 @@ test_files:
241
241
  - spec/lib/boa_vista/response_spec.rb
242
242
  - spec/lib/boa_vista/version_spec.rb
243
243
  - spec/spec_helper.rb
244
+ has_rdoc: