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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/gruf-rspec.gemspec +4 -2
- data/lib/gruf/rspec.rb +9 -1
- data/lib/gruf/rspec/authentication_hydrators/base.rb +2 -0
- data/lib/gruf/rspec/authentication_hydrators/basic.rb +2 -0
- data/lib/gruf/rspec/configuration.rb +4 -2
- data/lib/gruf/rspec/error_matcher.rb +3 -1
- data/lib/gruf/rspec/helpers.rb +5 -0
- data/lib/gruf/rspec/metadata_factory.rb +2 -0
- data/lib/gruf/rspec/version.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ed9353854df6b8345373aaa9a1e7fe2805070ae44dfb54bb14688a87a628aff
|
4
|
+
data.tar.gz: 22c988b77ec6ff5241c78acf040b46ce8bd27eb6f9a205d2699faa84769ca48e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b07409bcf8038200de8aab327a93a31ce98ee5ff5e7f35f934739014d12544d4019be9dfc8f4baa2a8d511ca59711220a9c1e15692a240d2b2a4545a5c8d729
|
7
|
+
data.tar.gz: 3ab93f84addeaaff283bedccf0b0b2293d245ea6bb491a83aac4295c570f52c3049c1d365454f452c639dde6bfa76f338563bf07e5fc83686fc6e5fe458b5e69
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/gruf-rspec.gemspec
CHANGED
@@ -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
|
-
|
32
|
-
|
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
|
|
data/lib/gruf/rspec.rb
CHANGED
@@ -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
|
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
|
@@ -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/'
|
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/'
|
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
|
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
|
data/lib/gruf/rspec/helpers.rb
CHANGED
@@ -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
|
data/lib/gruf/rspec/version.rb
CHANGED
@@ -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.
|
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.
|
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
|
+
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: '
|
120
|
+
version: '2.4'
|
121
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - ">="
|