gruf-rspec 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: d8d0d67cd2d8e98f3df81aa980be153313ccaaa01381d603f34dac2b7acdd9c9
4
- data.tar.gz: 9efd36045c83aeaed1815b463afa2c10b7bb14190604f1685cac6e0a89c16756
3
+ metadata.gz: 5ed9353854df6b8345373aaa9a1e7fe2805070ae44dfb54bb14688a87a628aff
4
+ data.tar.gz: 22c988b77ec6ff5241c78acf040b46ce8bd27eb6f9a205d2699faa84769ca48e
5
5
  SHA512:
6
- metadata.gz: 533a16373dfb91ccc3587194064a0be3c5108513683957f1be0d918fb6eb7d7785a4a2c2e31c1d0cba5595ccf82abf62b2df5b1c1c84f62c52f3d72fd8de7f10
7
- data.tar.gz: 1da2b6434529984d65bd04a3faf461bd5774a5719cf38d3bdd6b4be26864fbd995d5e387d4c07d5f5c2c4affa3f46bcd9eb6ee9b545c77c5b85e78e0129fc2ca
6
+ metadata.gz: 5b07409bcf8038200de8aab327a93a31ce98ee5ff5e7f35f934739014d12544d4019be9dfc8f4baa2a8d511ca59711220a9c1e15692a240d2b2a4545a5c8d729
7
+ data.tar.gz: 3ab93f84addeaaff283bedccf0b0b2293d245ea6bb491a83aac4295c570f52c3049c1d365454f452c639dde6bfa76f338563bf07e5fc83686fc6e5fe458b5e69
@@ -2,6 +2,10 @@ Changelog for the gruf-rspec gem.
2
2
 
3
3
  ### Pending release
4
4
 
5
+ ### 0.2.0
6
+
7
+ * Deprecate support for Ruby < 2.4
8
+
5
9
  ### 0.1.3
6
10
 
7
11
  * Add ability to include metadata in rpc calls
data/README.md CHANGED
@@ -17,7 +17,7 @@ Then add the following code to your `spec_helper.rb`:
17
17
  require 'gruf/rspec'
18
18
  ```
19
19
 
20
- Note that this gem requires at least Gruf 2.5.1+ and RSpec 3.8+.
20
+ Note that this gem requires at least Ruby 2.4+, Gruf 2.5.1+, and RSpec 3.8+.
21
21
 
22
22
  ## Usage
23
23
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -28,8 +30,8 @@ Gem::Specification.new do |spec|
28
30
  spec.description = %q{RSpec assistance library for gruf, including testing helpers}
29
31
  spec.homepage = 'https://github.com/bigcommerce/gruf-rspec'
30
32
 
31
- # Specify which files should be added to the gem when it is released.
32
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
33
+ spec.required_ruby_version = '~> 2.4'
34
+
33
35
  spec.files = Dir['README.md', 'CHANGELOG.md', 'CODE_OF_CONDUCT.md', 'lib/**/*', 'gruf-rspec.gemspec']
34
36
  spec.require_paths = ['lib']
35
37
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -29,7 +31,13 @@ require_relative 'rspec/configuration'
29
31
  require_relative 'rspec/helpers'
30
32
  require_relative 'rspec/error_matcher'
31
33
 
34
+ ##
35
+ # Base gruf module
36
+ #
32
37
  module Gruf
38
+ ##
39
+ # Base gruf-rspec module
40
+ #
33
41
  module Rspec
34
42
  extend Gruf::Rspec::Configuration
35
43
  end
@@ -54,7 +62,7 @@ GRUF_RSPEC_RUNNER.configure do |config|
54
62
  message: request
55
63
  )
56
64
  resp = @gruf_controller.call(@gruf_controller.request.method_key)
57
- block.call(resp) if block && block.is_a?(Proc)
65
+ block.call(resp) if block&.is_a?(Proc)
58
66
  resp
59
67
  end
60
68
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -27,7 +29,7 @@ module Gruf
27
29
  base: Gruf::Rspec::AuthenticationHydrators::Base,
28
30
  basic: Gruf::Rspec::AuthenticationHydrators::Basic
29
31
  },
30
- rpc_spec_path: '/spec/rpc/'.freeze
32
+ rpc_spec_path: '/spec/rpc/'
31
33
  }.freeze
32
34
 
33
35
  attr_accessor *VALID_CONFIG_KEYS.keys
@@ -71,7 +73,7 @@ module Gruf
71
73
  VALID_CONFIG_KEYS.each do |k, v|
72
74
  send((k.to_s + '='), v)
73
75
  end
74
- self.rpc_spec_path = '/spec/rpc/'.freeze
76
+ self.rpc_spec_path = '/spec/rpc/'
75
77
  options
76
78
  end
77
79
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -110,7 +112,7 @@ module Gruf
110
112
  # Deserialize the error from the response
111
113
  #
112
114
  def deserialize_error
113
- @error_serializer.new(@rpc_response.to_status.metadata[Gruf.error_metadata_key.to_sym]).deserialize if @error_serializer
115
+ @error_serializer&.new(@rpc_response.to_status.metadata[Gruf.error_metadata_key.to_sym])&.deserialize
114
116
  end
115
117
  end
116
118
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -17,6 +19,9 @@ require_relative 'metadata_factory'
17
19
 
18
20
  module Gruf
19
21
  module Rspec
22
+ ##
23
+ # Module for including rspec helpers
24
+ #
20
25
  module Helpers
21
26
  ##
22
27
  # @param [Hash] options
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -15,6 +17,6 @@
15
17
  #
16
18
  module Gruf
17
19
  module Rspec
18
- VERSION = '0.1.3'.freeze
20
+ VERSION = '0.2.0'
19
21
  end
20
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruf-rspec
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
  - Shaun McCormick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-06 00:00:00.000000000 Z
11
+ date: 2019-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -115,9 +115,9 @@ require_paths:
115
115
  - lib
116
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ">="
118
+ - - "~>"
119
119
  - !ruby/object:Gem::Version
120
- version: '0'
120
+ version: '2.4'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ">="