nfse-carioca 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/lib/nfse_carioca.rb +4 -0
  4. data/lib/nfse_carioca/gerar_nfse.rb +4 -0
  5. data/lib/nfse_carioca/gerar_nfse_xml.rb +121 -85
  6. data/lib/nfse_carioca/version.rb +1 -1
  7. data/nfse_carioca.gemspec +3 -2
  8. data/spec/fixtures/vcr_cassettes/NFSeCarioca_CancelarNFSe/_execute_/when_NFSeCarioca_rps_number_does_not_exist/returns_error_message.yml +4 -4
  9. data/spec/fixtures/vcr_cassettes/NFSeCarioca_CancelarNFSe/_execute_/when_NFSeCarioca_rps_number_does_not_exist/returns_false.yml +4 -4
  10. data/spec/fixtures/vcr_cassettes/NFSeCarioca_CancelarNFSe/_execute_/when_NFSeCarioca_rps_number_exist/returns_false.yml +8 -8
  11. data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error.yml +14 -66
  12. data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error_code_E10_.yml +248 -0
  13. data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error_message_E10_.yml +248 -0
  14. data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_message_error_E10_.yml +14 -66
  15. data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_does_not_exist_yet/generates_NFSeCarioca.yml +22 -74
  16. data/spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NfseCarioca_has_only_the_minimum_values/generates_NfseCarioca.yml +20 -59
  17. data/spec/lib/nfse_carioca/cancelar_nfse_spec.rb +1 -9
  18. data/spec/lib/nfse_carioca/gerar_nfse_spec.rb +58 -52
  19. data/spec/spec_helper.rb +17 -0
  20. metadata +23 -8
  21. data/spec/support/helpers.rb +0 -21
data/spec/spec_helper.rb CHANGED
@@ -5,6 +5,10 @@ require "nfse_carioca"
5
5
  require "pry"
6
6
  require "vcr"
7
7
 
8
+ def file_path(filename)
9
+ File.join(File.dirname(__FILE__), "fixtures", filename)
10
+ end
11
+
8
12
  VCR.configure do |config|
9
13
  config.cassette_library_dir = "spec/fixtures/vcr_cassettes"
10
14
  config.hook_into :webmock
@@ -22,6 +26,19 @@ RSpec.configure do |config|
22
26
  mocks.verify_partial_doubles = true
23
27
  end
24
28
 
29
+ config.before do
30
+ NfseCarioca.configure do |nfse|
31
+ nfse.cnpj = "12390095000186"
32
+ nfse.inscricao_municipal = "04807995"
33
+ nfse.test_mode = true
34
+
35
+ nfse.cert_path = file_path("cert.pem")
36
+ nfse.cert_key_path = file_path("key.pem")
37
+ nfse.ca_cert_path = file_path("ca_cert.pem")
38
+ nfse.cert_key_password = "ezXCgxHwcBmqLrXdFuxUjLbqGzhkEj9jNXq2VQfzGYgBxwAYwB"
39
+ end
40
+ end
41
+
25
42
  config.filter_run :focus
26
43
  config.run_all_when_everything_filtered = true
27
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfse-carioca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - LUZ Planilhas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-05 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.9.0
19
+ version: '2.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.9.0
26
+ version: '2.9'
27
27
  - !ruby/object:Gem::Dependency
28
- name: builder
28
+ name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.2
33
+ version: '4.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.2
40
+ version: '4.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: dotenv
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: NFSeCarioca é um cliente ruby com foco na geração da Nota Carioca
126
140
  email:
127
141
  - bruno@luz.vc
@@ -155,6 +169,8 @@ files:
155
169
  - spec/fixtures/vcr_cassettes/NFSeCarioca_CancelarNFSe/_execute_/when_NFSeCarioca_rps_number_does_not_exist/returns_false.yml
156
170
  - spec/fixtures/vcr_cassettes/NFSeCarioca_CancelarNFSe/_execute_/when_NFSeCarioca_rps_number_exist/returns_false.yml
157
171
  - spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error.yml
172
+ - spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error_code_E10_.yml
173
+ - spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_error_message_E10_.yml
158
174
  - spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_already_exist/responds_with_message_error_E10_.yml
159
175
  - spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NFSeCarioca_rps_number_does_not_exist_yet/generates_NFSeCarioca.yml
160
176
  - spec/fixtures/vcr_cassettes/NFSeCarioca_GerarNFSe/_call/when_NfseCarioca_has_only_the_minimum_values/generates_NfseCarioca.yml
@@ -162,7 +178,6 @@ files:
162
178
  - spec/lib/nfse_carioca/configuration_spec.rb
163
179
  - spec/lib/nfse_carioca/gerar_nfse_spec.rb
164
180
  - spec/spec_helper.rb
165
- - spec/support/helpers.rb
166
181
  homepage:
167
182
  licenses:
168
183
  - MIT
@@ -1,21 +0,0 @@
1
- def file_path(filename)
2
- File.expand_path("../../fixtures/#{filename}", __FILE__)
3
- end
4
-
5
- SavonResponseMock = Struct.new(:key, :content) do
6
- def hash
7
- {
8
- envelope: {
9
- body: {
10
- "#{key}": {
11
- output_xml: content
12
- }
13
- }
14
- }
15
- }
16
- end
17
- end
18
-
19
- def soap_response(filename)
20
- output_xml = IO.read(file_path("nota_carioca/#{filename}"))
21
- end