bigid_bgcheck 0.1.3 → 0.2.0

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
  SHA256:
3
- metadata.gz: fe1ebc273c327323e346cd5f95acdf0f416fe43b9df2b63af7a26f74125397ce
4
- data.tar.gz: 0a89cf40a825ad278c2ca22ca441e1cd7f2cb8e77c0884a17507cc207d3680dd
3
+ metadata.gz: f903afff79defb8eb07d63f3780fe8fc3aaabe64ed20e5adfdee40beccb194b7
4
+ data.tar.gz: 88c411f684ae5b8326346726f857dea42518bd369c8a7a94f1c454c53d254682
5
5
  SHA512:
6
- metadata.gz: 67a17203419ba2e66edbfdced0ddcb9d6affa3a12742bf55432ec0c30d60bd22abacda6b0ff656d755e340ab05a63bbd5f1b8984e0ef3c1ea1713b19d6305573
7
- data.tar.gz: 62b1d4edec6dde17d86342dcb06a4b01748b2bcb298a1776a81209bb2118ff8f514e859b9209703df49efff7519e94ea198d61ed7a1e3a21c5fda573259e2d73
6
+ metadata.gz: 71f42d87689bcb2c3d6c96e12949dc7ffe334915e984a9c4dbcd102afea6d17c6bdccf8e4b119b2da76cdc7a09ddfacf0c74cad0d3692dc2edda7e3562444ebd
7
+ data.tar.gz: 2c8c0aa0cf62b4e362398fd6d8cbff07efc80d9fd4889b3b8cdcf6d3e3c8a233577a253308ae7a67c79848e7beceb478d9ac125e3b154ac8d1e9461b1d010ba2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG for bigid_bgcheck
2
2
 
3
+ ## v0.2.0
4
+
5
+ Features
6
+
7
+ * Add fields to service return: "raw_data", "score_details", "related_score_details" and "raw_response" (the complete json file)
8
+
3
9
  ## v0.1.3
4
10
 
5
11
  * Fix a problem with the locale initialization in Rails projects
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021 Danilo Carolino
1
+ Copyright (c) 2021 Quasar Flash
2
2
 
3
3
  MIT LICENSE
4
4
 
data/README.md CHANGED
@@ -24,14 +24,15 @@ Installation for Rails
24
24
  -----------------
25
25
 
26
26
  # Add to the Gemfile
27
- gem 'bigid_bgcheck', '~> 0.1.0'
27
+ gem "bigid_bgcheck", "~> 0.2"
28
+ gem "bigid_bgcheck", github: "Quasar-Flash/bigid-bgcheck-ruby"
28
29
 
29
30
  Setting the BigID credentials
30
31
  -----------------
31
32
 
32
33
  # Set the env variables
33
- ENV['BIGID_USERNAME'] = 'your_username'
34
- ENV['BIGID_PASSWORD'] = 'your_password'
34
+ ENV["BIGID_USERNAME"] = "your_username"
35
+ ENV["BIGID_PASSWORD"] = "your_password"
35
36
 
36
37
  Setting the BigID credentials - Rails Project
37
38
  -----------------
@@ -40,19 +41,19 @@ Create the config/initializers/bigid.rb file and define:
40
41
 
41
42
  # Set the env variables
42
43
  Bigid.configure do |config|
43
- config.username = 'your_username'
44
- config.password = 'your_password'
44
+ config.username = "your_username"
45
+ config.password = "your_password"
45
46
  end
46
47
 
47
48
  Applying a background check
48
49
  -----------------
49
50
 
50
- require 'bigid_bgcheck'
51
+ require "bigid_bgcheck"
51
52
 
52
53
  Bigid::Bgcheck::Request.new.call(
53
- document: '000.000.000-00',
54
- document_type: 'CPF',
55
- group: 'Default'
54
+ document: "000.000.000-00",
55
+ document_type: "CPF",
56
+ group: "Default"
56
57
  )
57
58
 
58
59
  Result Example
@@ -76,8 +77,8 @@ Searching the [issues](https://github.com/Quasar-Flash/bigid-bgcheck-ruby/issues
76
77
  Contributing
77
78
  -----------------
78
79
 
79
- - Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet;
80
- - Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it;
80
+ - Check out the latest master to make sure the feature hasn"t been implemented or the bug hasn't been fixed yet;
81
+ - Check out the issue tracker to make sure someone already hasn"t requested it and/or contributed it;
81
82
  - Fork the project;
82
83
  - Start a feature/bugfix branch;
83
84
  - Commit and push until you are happy with your contribution;
data/Rakefile CHANGED
@@ -45,4 +45,4 @@ rescue LoadError
45
45
  # no rspec available
46
46
  end
47
47
 
48
- task default: %i[rubocop ]
48
+ task default: %i[rubocop spec]
@@ -47,11 +47,15 @@ module Bigid
47
47
 
48
48
  Bigid::Bgcheck::Result.new(
49
49
  approved: ResultCode.approved?(body["ResultCode"]),
50
- ticket_id: body["TicketId"],
51
50
  code: body["ResultCode"],
51
+ score_details: body["ScoreDetails"],
52
+ limit_score: body["LimitScore"],
52
53
  message: body["ResultMessage"],
54
+ raw_data: body["RawData"],
55
+ raw_response: body.to_json,
56
+ related_score_details: body["RelatedScoreDetails"],
53
57
  score: body["Score"],
54
- limit_score: body["LimitScore"]
58
+ ticket_id: body["TicketId"]
55
59
  )
56
60
  end
57
61
  end
@@ -3,15 +3,21 @@
3
3
  module Bigid
4
4
  module Bgcheck
5
5
  class Result
6
- attr_accessor :approved, :ticket_id, :code, :message, :score, :limit_score
6
+ attr_accessor :approved, :code, :score_details, :limit_score, :message, :raw_data,
7
+ :raw_response, :related_score_details, :score, :ticket_id
7
8
 
8
- def initialize(approved:, ticket_id:, code:, message:, score:, limit_score:)
9
- @approved = approved
10
- @ticket_id = ticket_id
11
- @code = code
12
- @message = message
13
- @score = score
14
- @limit_score = limit_score
9
+ def initialize(approved:, code:, score_details:, limit_score:, message:, raw_data:, raw_response:,
10
+ related_score_details:, score:, ticket_id:)
11
+ @approved = approved
12
+ @code = code
13
+ @score_details = score_details
14
+ @limit_score = limit_score
15
+ @message = message
16
+ @raw_data = raw_data
17
+ @raw_response = raw_response
18
+ @related_score_details = related_score_details
19
+ @score = score
20
+ @ticket_id = ticket_id
15
21
  end
16
22
  end
17
23
  end
@@ -9,6 +9,6 @@ module Bigid
9
9
  # Major - Incremented for incompatible changes with previous release (or big enough new features)
10
10
  # Minor - Incremented for new backwards-compatible features + deprecations
11
11
  # Patch - Incremented for backwards-compatible bug fixes
12
- VERSION = "0.1.3"
12
+ VERSION = "0.2.0"
13
13
  end
14
14
  end
data/lib/bigid_bgcheck.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require "faraday"
4
4
  require "i18n"
5
5
  require "json"
6
+ require "cpf_cnpj"
6
7
 
7
8
  require "bigid_auth"
8
9
 
@@ -26,24 +27,24 @@ I18n.load_path += Dir[File.join(__dir__, "locales", "**/*.yml")]
26
27
  I18n.reload! if I18n.backend.initialized?
27
28
 
28
29
  module Bigid
29
- module Bgcheck
30
- SRV_ENDPOINT = "backgroundcheck"
31
-
32
- class << self
33
- attr_writer :configuration
30
+ class << self
31
+ attr_writer :configuration
34
32
 
35
- def configuration
36
- @configuration ||= Configuration.new
37
- end
33
+ def configuration
34
+ @configuration ||= Configuration.new
38
35
  end
36
+ end
39
37
 
40
- def self.configure
41
- self.configuration ||= Configuration.new
38
+ def self.configure
39
+ self.configuration ||= Configuration.new
42
40
 
43
- yield(configuration)
44
- end
41
+ yield(configuration)
42
+ end
45
43
 
46
- class Configuration
47
- end
44
+ class Configuration
45
+ end
46
+
47
+ module Bgcheck
48
+ SRV_ENDPOINT = "backgroundcheck"
48
49
  end
49
50
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::BadRequestError do
6
+ include_examples "error"
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::BaseError do
6
+ include_examples "error"
7
+ end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "spec_helper"
4
- require "bigid/bgcheck/doc_type"
5
4
 
6
5
  RSpec.describe Bigid::Bgcheck::DocType do
7
6
  describe ".valid?(document_type)" do
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::DocumentNotSupportedError do
6
+ include_examples "error"
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::InternalError do
6
+ include_examples "http_error"
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::InvalidCredentialsError do
6
+ include_examples "error"
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::InvalidDocumentValueError do
6
+ include_examples "error"
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::NoInfoError do
6
+ include_examples "http_error"
7
+ end
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::Request do
6
+ describe "#call" do
7
+ let(:connection) { instance_double(Bigid::Auth::AuthenticatedConnection) }
8
+ let(:body) {
9
+ {
10
+ Login: "username_value",
11
+ parameters: { CNPJ: document },
12
+ Group: group
13
+ }.to_json
14
+ }
15
+ let(:success_result) { build(:result, :approved) }
16
+ let(:success_result_response) {
17
+ JSON.parse({
18
+ body: {
19
+ RawData: success_result.raw_data,
20
+ ScoreDetails: success_result.score_details,
21
+ RelatedScoreDetails: success_result.related_score_details,
22
+ LimitScore: success_result.limit_score,
23
+ ResultCode: success_result.code,
24
+ ResultMessage: success_result.message,
25
+ Score: success_result.score,
26
+ TicketId: success_result.ticket_id
27
+ }.to_json,
28
+ status: request_status
29
+ }.to_json, object_class: OpenStruct)
30
+ }
31
+ let(:document) { CNPJ.generate }
32
+ let(:document_type) { "CNPJ" }
33
+ let(:group) { "Default" }
34
+ let(:request_status) { 200 }
35
+
36
+ subject { described_class.new.call(document: document, document_type: document_type, group: group) }
37
+
38
+ before do
39
+ allow(Bigid::Auth::AuthenticatedConnection).to receive(:new).and_return(connection)
40
+ allow(connection).to receive(:post).and_return(success_result_response)
41
+ end
42
+
43
+ describe ".call" do
44
+ subject { described_class.call(document: document, document_type: document_type, group: group) }
45
+
46
+ it { expect(subject).to be_kind_of(Bigid::Bgcheck::Result) }
47
+
48
+ it { subject; expect(connection).to have_received(:post) }
49
+ end
50
+
51
+ context "when all parameters are valid" do
52
+ it { expect(subject).to be_kind_of(Bigid::Bgcheck::Result) }
53
+
54
+ it { subject; expect(connection).to have_received(:post) }
55
+ end
56
+
57
+ context "when document type is invalid" do
58
+ let(:document_type) { "CNP" }
59
+
60
+ it { expect { subject }.to raise_error(Bigid::Bgcheck::DocumentNotSupportedError) }
61
+ end
62
+
63
+ context "when request status is null" do
64
+ let(:request_status) { nil }
65
+
66
+ it { expect { subject }.to raise_error(Bigid::Bgcheck::InternalError) }
67
+ end
68
+
69
+ context "when request status is server error" do
70
+ let(:request_status) { 500 }
71
+
72
+ it { expect { subject }.to raise_error(Bigid::Bgcheck::ServerError) }
73
+ end
74
+
75
+ context "when request status is auth error" do
76
+ let(:request_status) { 401 }
77
+
78
+ it { expect { subject }.to raise_error(Bigid::Bgcheck::InvalidCredentialsError) }
79
+ end
80
+
81
+ context "when request status is bad request" do
82
+ let(:request_status) { 400 }
83
+
84
+ it { expect { subject }.to raise_error(Bigid::Bgcheck::BadRequestError) }
85
+ end
86
+
87
+ context "when the result code is empty" do
88
+ let(:success_result) { build(:result, :approved, code: nil) }
89
+
90
+ it { expect { subject }.to raise_error(Bigid::Bgcheck::InvalidDocumentValueError) }
91
+ end
92
+
93
+ context "when the result code is empty" do
94
+ let(:success_result) { build(:result, :approved, code: Bigid::Bgcheck::ResultCode::NO_INFO) }
95
+
96
+ it { expect { subject }.to raise_error(Bigid::Bgcheck::NoInfoError) }
97
+ end
98
+ end
99
+ end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "spec_helper"
4
- require "bigid/bgcheck/result_code"
5
4
 
6
5
  RSpec.describe Bigid::Bgcheck::ResultCode do
7
6
  describe ".valid?(code)" do
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.describe Bigid::Bgcheck::ServerError do
6
+ include_examples "error"
7
+ end
@@ -1,44 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "spec_helper"
4
- require "bigid_bgcheck"
5
4
 
6
5
  RSpec.describe Bigid::Bgcheck do
7
- describe "BASE_URL" do
8
- subject { defined? Bigid::Bgcheck::BASE_URL }
9
-
10
- it { expect(subject).to be_truthy }
11
- end
12
-
13
- describe "AUTH_ENDPOINT" do
14
- subject { defined? Bigid::Bgcheck::AUTH_ENDPOINT }
15
-
16
- it { expect(subject).to be_truthy }
17
- end
18
-
19
6
  describe "SRV_ENDPOINT" do
20
7
  subject { defined? Bigid::Bgcheck::SRV_ENDPOINT }
21
8
 
22
9
  it { expect(subject).to be_truthy }
23
10
  end
24
11
 
25
- describe "TOKEN_EXPIRATION" do
26
- subject { defined? Bigid::Bgcheck::TOKEN_EXPIRATION }
27
-
28
- it { expect(subject).to be_truthy }
29
- end
30
-
31
12
  describe ".configure" do
32
13
  before do
33
- described_class.configuration = nil
14
+ Bigid.configuration = nil
34
15
  ENV.clear
35
16
  end
36
17
 
37
- subject { described_class.configuration }
18
+ subject { Bigid.configuration }
38
19
 
39
20
  context "when configuration is defined" do
40
21
  before do
41
- described_class.configure do |config|
22
+ Bigid.configure do |config|
42
23
  config.username = "username_value"
43
24
  config.password = "password_value"
44
25
  end
@@ -77,7 +58,7 @@ RSpec.describe Bigid::Bgcheck do
77
58
  ENV["BIGID_USERNAME"] = "username_value"
78
59
  ENV["BIGID_PASSWORD"] = "password_value"
79
60
 
80
- described_class.configure do |config|
61
+ Bigid.configure do |config|
81
62
  config.username = "username_value2"
82
63
  config.password = "password_value2"
83
64
  end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ FactoryBot.define do
4
+ factory :result, class: "Bigid::Bgcheck::Result" do
5
+ trait :approved do
6
+ approved { true }
7
+ code { Bigid::Bgcheck::ResultCode::APPROVED }
8
+ score_details { {} }
9
+ limit_score { 10.0 }
10
+ message { "Approved" }
11
+ score { 10.0 }
12
+ ticket_id { SecureRandom.hex(8) }
13
+ raw_data { "{}" }
14
+ raw_response { "{\"ScoreDetails\":#{score_details},\"LimitScore\":#{limit_score},\"ResultCode\":#{code},\"ResultMessage\":\"#{message}\",\"Score\":#{score},\"TicketId\":\"#{ticket_id}\"}" }
15
+ related_score_details { "{}" }
16
+ end
17
+
18
+ trait :unapproved do
19
+ approved { false }
20
+ code { Bigid::Bgcheck::ResultCode::NOT_APPROVED }
21
+ score_details { }
22
+ limit_score { 10.0 }
23
+ message { "Not Approved" }
24
+ raw_response { "{\"ScoreDetails\":null,\"LimitScore\":10.0,\"ResultCode\":90,\"ResultMessage\":\"Approved\",\"Score\":10.0,\"TicketId\":\"d735711aeb909de9\"}" }
25
+ score { 1.0 }
26
+ ticket_id { SecureRandom.hex(8) }
27
+ end
28
+
29
+ initialize_with do
30
+ new(
31
+ approved: approved,
32
+ code: code,
33
+ score_details: score_details,
34
+ limit_score: limit_score,
35
+ message: message,
36
+ raw_data: raw_data,
37
+ raw_response: raw_response,
38
+ related_score_details: related_score_details,
39
+ score: score,
40
+ score_details: score_details,
41
+ ticket_id: ticket_id
42
+ )
43
+ end
44
+ end
45
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "simplecov"
4
+
5
+ SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter]
6
+ SimpleCov.minimum_coverage 70.0
7
+
8
+ SimpleCov.start do
9
+ add_filter "/spec/"
10
+ minimum_coverage 70
11
+ minimum_coverage_by_file 50
12
+ end
13
+
14
+ require "bigid_auth"
15
+ require "bigid/bgcheck/base_error"
16
+
17
+ Dir["./spec/support/**/*.rb"].each { |f| require f }
18
+ Dir["./spec/initializers/**/*.rb"].each { |f| require f }
19
+ Dir["./lib/**/*.rb"].sort.each { |file| require file }
20
+
3
21
  require "rubygems"
4
22
  require "bundler"
23
+ require "bigid_bgcheck"
24
+ require "factory_bot"
25
+ require "pry"
5
26
 
6
27
  begin
7
28
  Bundler.setup(:default, :development, :test)
@@ -12,14 +33,15 @@ rescue Bundler::BundlerError => e
12
33
  exit e.status_code
13
34
  end
14
35
 
15
- require "simplecov"
36
+ RSpec.configure do |config|
37
+ config.include FactoryBot::Syntax::Methods
16
38
 
17
- SimpleCov.start do
18
- add_filter "spec"
19
- end
39
+ # Enable flags like --only-failures and --next-failure
40
+ config.example_status_persistence_file_path = ".rspec_status"
20
41
 
21
- RSpec.configure do |config|
22
- # some (optional) config here
42
+ config.expect_with :rspec do |c|
43
+ c.syntax = :expect
44
+ end
23
45
  end
24
46
 
25
- # minitest/mock # Uncomment me to use minitest mocks
47
+ FactoryBot.find_definitions
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec.shared_examples "error" do
6
+ describe ".initialize" do
7
+ context "when message parameter is null" do
8
+ subject { described_class.new.message }
9
+
10
+ it { expect(subject).to eq(described_class.default_message) }
11
+ end
12
+
13
+ context "when message parameter is not null" do
14
+ subject { described_class.new(message).message }
15
+
16
+ let(:message) { "message" }
17
+
18
+ it { expect(subject).to eq(message) }
19
+ end
20
+ end
21
+
22
+ describe ".default_message" do
23
+ let(:expected_result) { I18n.t("errors.#{described_class.name.underscore.tr("/", ".")}") }
24
+
25
+ subject { described_class.default_message }
26
+
27
+ it "searches the default message in I18n using the class name" do
28
+ expect(subject).to eq(expected_result)
29
+ end
30
+ end
31
+ end
32
+
33
+ RSpec.shared_examples "http_error" do
34
+ include_examples "error"
35
+
36
+ describe "#http_status" do
37
+ subject { described_class.new.http_status }
38
+
39
+ it { expect(subject).to eq(described_class::HTTP_STATUS) }
40
+ end
41
+
42
+ describe "#status" do
43
+ subject { described_class.new.status }
44
+
45
+ it { expect(subject).to eq(described_class::STATUS) }
46
+ end
47
+
48
+ describe "#status_code" do
49
+ subject { described_class.new.status_code }
50
+
51
+ it { expect(subject).to eq(described_class::STATUS_CODE) }
52
+ end
53
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigid_bgcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Carolino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-19 00:00:00.000000000 Z
11
+ date: 2021-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigid_auth
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.1
19
+ version: '0.1'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: '0.1'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 0.1.1
29
+ version: '0.1'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0.1'
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 1.4.1
39
+ version: '1.4'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '1.0'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 1.4.1
49
+ version: '1.4'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: '1.0'
@@ -56,7 +56,7 @@ dependencies:
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: 1.8.0
59
+ version: '1.8'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '1.0'
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 1.8.0
69
+ version: '1.8'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: '1.0'
@@ -76,7 +76,7 @@ dependencies:
76
76
  requirements:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
- version: 2.5.0
79
+ version: '2.5'
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
@@ -86,66 +86,86 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 2.5.0
89
+ version: '2.5'
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: '2.0'
93
+ - !ruby/object:Gem::Dependency
94
+ name: cpf_cnpj
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '0.5'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0.5'
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.5'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0.5'
93
113
  - !ruby/object:Gem::Dependency
94
114
  name: bundler
95
115
  requirement: !ruby/object:Gem::Requirement
96
116
  requirements:
97
117
  - - ">="
98
118
  - !ruby/object:Gem::Version
99
- version: 1.2.0
119
+ version: '1.2'
100
120
  type: :development
101
121
  prerelease: false
102
122
  version_requirements: !ruby/object:Gem::Requirement
103
123
  requirements:
104
124
  - - ">="
105
125
  - !ruby/object:Gem::Version
106
- version: 1.2.0
126
+ version: '1.2'
107
127
  - !ruby/object:Gem::Dependency
108
128
  name: factory_bot
109
129
  requirement: !ruby/object:Gem::Requirement
110
130
  requirements:
111
131
  - - "~>"
112
132
  - !ruby/object:Gem::Version
113
- version: 6.1.0
133
+ version: '6.2'
114
134
  type: :development
115
135
  prerelease: false
116
136
  version_requirements: !ruby/object:Gem::Requirement
117
137
  requirements:
118
138
  - - "~>"
119
139
  - !ruby/object:Gem::Version
120
- version: 6.1.0
140
+ version: '6.2'
121
141
  - !ruby/object:Gem::Dependency
122
- name: gemsurance
142
+ name: fuubar
123
143
  requirement: !ruby/object:Gem::Requirement
124
144
  requirements:
125
145
  - - "~>"
126
146
  - !ruby/object:Gem::Version
127
- version: '0.10'
147
+ version: '2.5'
128
148
  type: :development
129
149
  prerelease: false
130
150
  version_requirements: !ruby/object:Gem::Requirement
131
151
  requirements:
132
152
  - - "~>"
133
153
  - !ruby/object:Gem::Version
134
- version: '0.10'
154
+ version: '2.5'
135
155
  - !ruby/object:Gem::Dependency
136
156
  name: pry
137
157
  requirement: !ruby/object:Gem::Requirement
138
158
  requirements:
139
159
  - - "~>"
140
160
  - !ruby/object:Gem::Version
141
- version: 0.14.0
161
+ version: '0.14'
142
162
  type: :development
143
163
  prerelease: false
144
164
  version_requirements: !ruby/object:Gem::Requirement
145
165
  requirements:
146
166
  - - "~>"
147
167
  - !ruby/object:Gem::Version
148
- version: 0.14.0
168
+ version: '0.14'
149
169
  - !ruby/object:Gem::Dependency
150
170
  name: rake
151
171
  requirement: !ruby/object:Gem::Requirement
@@ -172,70 +192,70 @@ dependencies:
172
192
  requirements:
173
193
  - - "~>"
174
194
  - !ruby/object:Gem::Version
175
- version: 3.10.0
195
+ version: '3.10'
176
196
  type: :development
177
197
  prerelease: false
178
198
  version_requirements: !ruby/object:Gem::Requirement
179
199
  requirements:
180
200
  - - "~>"
181
201
  - !ruby/object:Gem::Version
182
- version: 3.10.0
202
+ version: '3.10'
183
203
  - !ruby/object:Gem::Dependency
184
204
  name: rubocop
185
205
  requirement: !ruby/object:Gem::Requirement
186
206
  requirements:
187
207
  - - "~>"
188
208
  - !ruby/object:Gem::Version
189
- version: 1.12.0
209
+ version: '1.17'
190
210
  type: :development
191
211
  prerelease: false
192
212
  version_requirements: !ruby/object:Gem::Requirement
193
213
  requirements:
194
214
  - - "~>"
195
215
  - !ruby/object:Gem::Version
196
- version: 1.12.0
216
+ version: '1.17'
197
217
  - !ruby/object:Gem::Dependency
198
218
  name: rubocop-packaging
199
219
  requirement: !ruby/object:Gem::Requirement
200
220
  requirements:
201
221
  - - "~>"
202
222
  - !ruby/object:Gem::Version
203
- version: 0.5.0
223
+ version: '0.5'
204
224
  type: :development
205
225
  prerelease: false
206
226
  version_requirements: !ruby/object:Gem::Requirement
207
227
  requirements:
208
228
  - - "~>"
209
229
  - !ruby/object:Gem::Version
210
- version: 0.5.0
230
+ version: '0.5'
211
231
  - !ruby/object:Gem::Dependency
212
232
  name: rubocop-performance
213
233
  requirement: !ruby/object:Gem::Requirement
214
234
  requirements:
215
235
  - - "~>"
216
236
  - !ruby/object:Gem::Version
217
- version: 1.10.0
237
+ version: '1.11'
218
238
  type: :development
219
239
  prerelease: false
220
240
  version_requirements: !ruby/object:Gem::Requirement
221
241
  requirements:
222
242
  - - "~>"
223
243
  - !ruby/object:Gem::Version
224
- version: 1.10.0
244
+ version: '1.11'
225
245
  - !ruby/object:Gem::Dependency
226
246
  name: simplecov
227
247
  requirement: !ruby/object:Gem::Requirement
228
248
  requirements:
229
249
  - - "~>"
230
250
  - !ruby/object:Gem::Version
231
- version: 0.21.0
251
+ version: 0.21.2
232
252
  type: :development
233
253
  prerelease: false
234
254
  version_requirements: !ruby/object:Gem::Requirement
235
255
  requirements:
236
256
  - - "~>"
237
257
  - !ruby/object:Gem::Version
238
- version: 0.21.0
258
+ version: 0.21.2
239
259
  description: A library to use BigData Corps background check features
240
260
  email:
241
261
  - danilo.carolino@qflash.com.br
@@ -263,10 +283,21 @@ files:
263
283
  - lib/bigid_bgcheck.rb
264
284
  - lib/locales/en.yml
265
285
  - lib/locales/pt-BR.yml
286
+ - spec/bigid/bgcheck/bad_request_error_spec.rb
287
+ - spec/bigid/bgcheck/base_error_spec.rb
288
+ - spec/bigid/bgcheck/doc_type_spec.rb
289
+ - spec/bigid/bgcheck/document_not_supported_error_spec.rb
290
+ - spec/bigid/bgcheck/internal_error_spec.rb
291
+ - spec/bigid/bgcheck/invalid_credentials_error_spec.rb
292
+ - spec/bigid/bgcheck/invalid_document_value_error_spec.rb
293
+ - spec/bigid/bgcheck/no_info_error_spec.rb
294
+ - spec/bigid/bgcheck/request_spec.rb
295
+ - spec/bigid/bgcheck/result_code_spec.rb
296
+ - spec/bigid/bgcheck/server_error_spec.rb
266
297
  - spec/bigid_bgcheck_spec.rb
267
- - spec/lib/bgcheck/doc_type_spec.rb
268
- - spec/lib/bgcheck/result_code_spec.rb
298
+ - spec/factories/result.rb
269
299
  - spec/spec_helper.rb
300
+ - spec/support/shared_examples/errors_shared_examples.rb
270
301
  homepage: https://github.com/Quasar-Flash/bigid-bgcheck-ruby
271
302
  licenses:
272
303
  - MIT
@@ -289,12 +320,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
320
  - !ruby/object:Gem::Version
290
321
  version: '0'
291
322
  requirements: []
292
- rubygems_version: 3.1.4
323
+ rubygems_version: 3.2.15
293
324
  signing_key:
294
325
  specification_version: 4
295
326
  summary: Bigid Background Check Library
296
327
  test_files:
328
+ - spec/bigid/bgcheck/bad_request_error_spec.rb
329
+ - spec/bigid/bgcheck/base_error_spec.rb
330
+ - spec/bigid/bgcheck/doc_type_spec.rb
331
+ - spec/bigid/bgcheck/document_not_supported_error_spec.rb
332
+ - spec/bigid/bgcheck/internal_error_spec.rb
333
+ - spec/bigid/bgcheck/invalid_credentials_error_spec.rb
334
+ - spec/bigid/bgcheck/invalid_document_value_error_spec.rb
335
+ - spec/bigid/bgcheck/no_info_error_spec.rb
336
+ - spec/bigid/bgcheck/request_spec.rb
337
+ - spec/bigid/bgcheck/result_code_spec.rb
338
+ - spec/bigid/bgcheck/server_error_spec.rb
297
339
  - spec/bigid_bgcheck_spec.rb
298
- - spec/lib/bgcheck/result_code_spec.rb
299
- - spec/lib/bgcheck/doc_type_spec.rb
340
+ - spec/factories/result.rb
300
341
  - spec/spec_helper.rb
342
+ - spec/support/shared_examples/errors_shared_examples.rb