gruf-rspec 0.2.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1438b942b07a94abed41b3222ddbcd861b8cfd93bcedb1c6bfd55fdad10b352d
4
- data.tar.gz: 27000b5f85274a82000db3124cff07a483fab993ef7da5cf8c14377afc9c5dd4
3
+ metadata.gz: 236b6540ce7b46849e1555545c2d33077af0cb551799f172f241de2e2d618699
4
+ data.tar.gz: f7e800ef23126d40077fa324630ce5645743e9673a602fb7dfcb4e08a8a55282
5
5
  SHA512:
6
- metadata.gz: 19cadecb503ffdeb23c2b6d81c62824c8a273b93d94985b260e294c95d1e1ac5eb063462f705588e17086ae58e2dde7c754d991be57806ea748b9b23df9ba3cb
7
- data.tar.gz: '0870f789af166c2768542edb1d29dd5eed81bcf2447fcbe4d7c56dd73e538bfabb2e8bc68bc6ab16e3689bfa083dc3cd12da910631fc89e96238ef4064b4a1b0'
6
+ metadata.gz: 3b1ba006790a428f9b55fce3027e7d2f2fd9f62f07c241a7af4dd19479a58c64e23275ded044d305453801801a9333b92db8927195a3f5f4f5b1aff6eceb5789
7
+ data.tar.gz: 80138e96b2df8575553f8f186d6968502292cef59f4e941420ac42cb62a4e26eed88d231a6c9adc4218f05604b2377ab2d6cfeefe2f8dcf86c3ea874fb61b12e
data/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@ Changelog for the gruf-rspec gem.
2
2
 
3
3
  ### Pending release
4
4
 
5
+ ### 0.5.0
6
+
7
+ - Add support for Ruby 3.1
8
+ - Drop support for Ruby 2.6
9
+
10
+ ### 0.4.0
11
+
12
+ - Remove unnecessarily strict dev dependencies
13
+ - Adds support for Ruby 3.0 into test suite
14
+
15
+ ### 0.3.0
16
+
17
+ - [#7] Fix issue where RPC_SPEC_PATH defaulting is hardcoded
18
+ - Drop support for Ruby < 2.6, add 2.7 tests
19
+ - Update rubocop to 1.0
20
+
5
21
  ### 0.2.2
6
22
 
7
23
  * Loosen rspec dependency
@@ -16,7 +32,7 @@ Changelog for the gruf-rspec gem.
16
32
 
17
33
  ### 0.1.3
18
34
 
19
- * Add ability to include metadata in rpc calls
35
+ * Add ability to include metadata in rpc callsa
20
36
 
21
37
  ### 0.1.2
22
38
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # gruf-rspec
2
2
 
3
- [![CircleCI](https://circleci.com/gh/bigcommerce/gruf-rspec/tree/master.svg?style=svg)](https://circleci.com/gh/bigcommerce/gruf-rspec/tree/master) [![Gem Version](https://badge.fury.io/rb/gruf-rspec.svg)](https://badge.fury.io/rb/gruf-rspec) [![Documentation](https://inch-ci.org/github/bigcommerce/gruf-rspec.svg?branch=master)](https://inch-ci.org/github/bigcommerce/gruf-rspec?branch=master)
3
+ [![CircleCI](https://circleci.com/gh/bigcommerce/gruf-rspec/tree/main.svg?style=svg)](https://circleci.com/gh/bigcommerce/gruf-rspec/tree/main) [![Gem Version](https://badge.fury.io/rb/gruf-rspec.svg)](https://badge.fury.io/rb/gruf-rspec) [![Documentation](https://inch-ci.org/github/bigcommerce/gruf-rspec.svg?branch=main)](https://inch-ci.org/github/bigcommerce/gruf-rspec?branch=main) [![Maintainability](https://api.codeclimate.com/v1/badges/db2d134a7148dde045b7/maintainability)](https://codeclimate.com/github/bigcommerce/gruf-rspec/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/db2d134a7148dde045b7/test_coverage)](https://codeclimate.com/github/bigcommerce/gruf-rspec/test_coverage)
4
4
 
5
5
  Assistance helpers and custom type for easy testing [Gruf](https://github.com/bigcommerce/gruf) controllers with
6
6
  [RSpec](https://github.com/rspec/rspec).
@@ -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 Ruby 2.4+, Gruf 2.5.1+, and RSpec 3.8+.
20
+ Note that this gem requires at least Ruby 2.7+, Gruf 2.5.1+, and RSpec 3.8+.
21
21
 
22
22
  ## Usage
23
23
 
@@ -129,6 +129,23 @@ Gruf::Rspec.configure do |c|
129
129
  end
130
130
  ```
131
131
 
132
+ Alternatively, you can pass configuration of the path via ENV. For example, where
133
+ `RPC_SPEC_PATH="/spec/rpc_controllers"` is set in a `.env` file:
134
+
135
+ ```bash
136
+ bundle exec dotenv rspec
137
+ ```
138
+
139
+ Or, add `require: false` to the gemspec for the `gruf-rspec` gem, and then explicitly require it after setting the ENV
140
+ var:
141
+
142
+ ```ruby
143
+ Dotenv.load # assuming the .env file has the RPC_SPEC_PATH var set
144
+ # or:
145
+ ENV['RPC_SPEC_PATH'] = '/spec/rpc_controllers'
146
+ require 'gruf/rspec'
147
+ ```
148
+
132
149
  ## License
133
150
 
134
151
  Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
data/gruf-rspec.gemspec CHANGED
@@ -15,7 +15,7 @@
15
15
  # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16
16
  # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
17
  #
18
- lib = File.expand_path('../lib', __FILE__)
18
+ lib = File.expand_path('lib', __dir__)
19
19
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
20
20
  require 'gruf/rspec/version'
21
21
 
@@ -26,19 +26,21 @@ Gem::Specification.new do |spec|
26
26
  spec.email = ['splittingred@gmail.com']
27
27
  spec.license = 'MIT'
28
28
 
29
- spec.summary = %q{RSpec assistance library for gruf}
30
- spec.description = %q{RSpec assistance library for gruf, including testing helpers}
29
+ spec.summary = 'RSpec assistance library for gruf'
30
+ spec.description = 'RSpec assistance library for gruf, including testing helpers'
31
31
  spec.homepage = 'https://github.com/bigcommerce/gruf-rspec'
32
32
 
33
- spec.required_ruby_version = '~> 2.4'
33
+ spec.required_ruby_version = '>= 2.7'
34
34
 
35
35
  spec.files = Dir['README.md', 'CHANGELOG.md', 'CODE_OF_CONDUCT.md', 'lib/**/*', 'gruf-rspec.gemspec']
36
36
  spec.require_paths = ['lib']
37
37
 
38
- spec.add_development_dependency 'bundler', '~> 1.17'
39
- spec.add_development_dependency 'rake', '>= 12.3'
40
- spec.add_development_dependency 'pry'
38
+ spec.add_development_dependency 'bundler-audit', '>= 0.6'
39
+ spec.add_development_dependency 'pry', '>= 0.13'
40
+ spec.add_development_dependency 'rspec_junit_formatter', '>= 0.4'
41
+ spec.add_development_dependency 'rubocop', '>= 0.82'
42
+ spec.add_development_dependency 'simplecov', '>= 0.15'
41
43
 
42
- spec.add_dependency 'gruf', '~> 2.5', '>= 2.5.1'
43
- spec.add_dependency 'rspec', '>= 3.8'
44
+ spec.add_runtime_dependency 'gruf', '~> 2.5', '>= 2.5.1'
45
+ spec.add_runtime_dependency 'rspec', '>= 3.8'
44
46
  end
@@ -24,12 +24,14 @@ module Gruf
24
24
  # Represents configuration settings for the system
25
25
  #
26
26
  module Configuration
27
+ DEFAULT_RSPEC_PATH = '/spec/rpc/'
28
+
27
29
  VALID_CONFIG_KEYS = {
28
30
  authentication_hydrators: {
29
31
  base: Gruf::Rspec::AuthenticationHydrators::Base,
30
32
  basic: Gruf::Rspec::AuthenticationHydrators::Basic
31
33
  },
32
- rpc_spec_path: ENV.fetch('RPC_SPEC_PATH', '/spec/rpc/').to_s,
34
+ rpc_spec_path: ENV.fetch('RPC_SPEC_PATH', DEFAULT_RSPEC_PATH).to_s
33
35
  }.freeze
34
36
 
35
37
  attr_accessor *VALID_CONFIG_KEYS.keys
@@ -71,9 +73,9 @@ module Gruf
71
73
  #
72
74
  def reset
73
75
  VALID_CONFIG_KEYS.each do |k, v|
74
- send((k.to_s + '='), v)
76
+ send("#{k}=", v)
75
77
  end
76
- self.rpc_spec_path = '/spec/rpc/'
78
+ self.rpc_spec_path = ::ENV.fetch('RPC_SPEC_PATH', DEFAULT_RSPEC_PATH).to_s
77
79
  options
78
80
  end
79
81
  end
@@ -17,6 +17,6 @@
17
17
  #
18
18
  module Gruf
19
19
  module Rspec
20
- VERSION = '0.2.2'
20
+ VERSION = '0.5.0'
21
21
  end
22
22
  end
data/lib/gruf/rspec.rb CHANGED
@@ -62,7 +62,7 @@ GRUF_RSPEC_RUNNER.configure do |config|
62
62
  message: request
63
63
  )
64
64
  resp = @gruf_controller.call(@gruf_controller.request.method_key)
65
- block.call(resp) if block&.is_a?(Proc)
65
+ block.call(resp) if block.is_a?(Proc)
66
66
  resp
67
67
  end
68
68
 
metadata CHANGED
@@ -1,57 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruf-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun McCormick
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-31 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: bundler-audit
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
19
+ version: '0.6'
20
20
  type: :development
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: '1.17'
26
+ version: '0.6'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '12.3'
33
+ version: '0.13'
34
34
  type: :development
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: '12.3'
40
+ version: '0.13'
41
41
  - !ruby/object:Gem::Dependency
42
- name: pry
42
+ name: rspec_junit_formatter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '0.4'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '0.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0.82'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0.82'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0.15'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0.15'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: gruf
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -109,23 +137,23 @@ homepage: https://github.com/bigcommerce/gruf-rspec
109
137
  licenses:
110
138
  - MIT
111
139
  metadata: {}
112
- post_install_message:
140
+ post_install_message:
113
141
  rdoc_options: []
114
142
  require_paths:
115
143
  - lib
116
144
  required_ruby_version: !ruby/object:Gem::Requirement
117
145
  requirements:
118
- - - "~>"
146
+ - - ">="
119
147
  - !ruby/object:Gem::Version
120
- version: '2.4'
148
+ version: '2.7'
121
149
  required_rubygems_version: !ruby/object:Gem::Requirement
122
150
  requirements:
123
151
  - - ">="
124
152
  - !ruby/object:Gem::Version
125
153
  version: '0'
126
154
  requirements: []
127
- rubygems_version: 3.0.6
128
- signing_key:
155
+ rubygems_version: 3.3.3
156
+ signing_key:
129
157
  specification_version: 4
130
158
  summary: RSpec assistance library for gruf
131
159
  test_files: []