rspice 0.14.3 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspice/shared_examples/a_class_pass_method.rb +7 -11
- data/lib/rspice/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c52e2cf71a97dbb8b77b53d93cb700e15bf5cb8e0cb8de4186352b2d63c03a7a
|
4
|
+
data.tar.gz: 24350eed090ad293be248d531e91fafd544e6bf6d691e2283bb107c681443d92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c539528c59485c54d26cab19c3a816116d791c96b636e1d476a8d6e3cb69409c28a2ab743da8d4baea1eb65358beb13be6476627954e749b5e735464d391e796
|
7
|
+
data.tar.gz: d7ccf34575bb15f663c13e63d03daedcf7baf2de806c42301b8184e46817781f49fef30cb53548c5234daa36a35113c990de089f9e256067b8be17310295936c
|
@@ -34,13 +34,13 @@
|
|
34
34
|
RSpec.shared_examples_for "a class pass method" do |method|
|
35
35
|
subject do
|
36
36
|
if accepts_block?
|
37
|
-
call_class.public_send(method, *arguments, &block)
|
37
|
+
call_class.public_send(method, *arguments, **options, &block)
|
38
38
|
else
|
39
|
-
call_class.public_send(method, *arguments)
|
39
|
+
call_class.public_send(method, *arguments, **options)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
let(:call_class) {
|
43
|
+
let(:call_class) { test_class }
|
44
44
|
let(:test_class) { described_class }
|
45
45
|
|
46
46
|
let(:method_parameters) { test_class.instance_method(:initialize).parameters }
|
@@ -48,11 +48,7 @@ RSpec.shared_examples_for "a class pass method" do |method|
|
|
48
48
|
let(:option_keys) { method_parameters.select { |param| param.first.in?(%i[key keyreq]) }.map(&:last) }
|
49
49
|
let(:accepts_block?) { method_parameters.any? { |param| param.first == :block } }
|
50
50
|
|
51
|
-
let(:arguments)
|
52
|
-
Array.new(argument_arity) { double }.tap do |array|
|
53
|
-
array << options if options.present?
|
54
|
-
end
|
55
|
-
end
|
51
|
+
let(:arguments) { Array.new(argument_arity) { double } }
|
56
52
|
let(:options) { option_keys.each_with_object({}) { |key, hash| hash[key] = Faker::Lorem.word } }
|
57
53
|
let(:block) { -> {} }
|
58
54
|
let(:instance) { instance_double(test_class) }
|
@@ -62,9 +58,9 @@ RSpec.shared_examples_for "a class pass method" do |method|
|
|
62
58
|
allow(instance).to receive(method).and_return(output)
|
63
59
|
|
64
60
|
if accepts_block?
|
65
|
-
allow(test_class).to receive(:new).with(*arguments, &block).and_return(instance)
|
66
|
-
elsif arguments.any?
|
67
|
-
allow(test_class).to receive(:new).with(*arguments).and_return(instance)
|
61
|
+
allow(test_class).to receive(:new).with(*arguments, **options, &block).and_return(instance)
|
62
|
+
elsif arguments.any? || options.any?
|
63
|
+
allow(test_class).to receive(:new).with(*arguments, **options).and_return(instance)
|
68
64
|
else
|
69
65
|
allow(test_class).to receive(:new).with(no_args).and_return(instance)
|
70
66
|
end
|
data/lib/rspice/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Garside
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-08-
|
14
|
+
date: 2019-08-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
@@ -106,7 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
|
-
|
109
|
+
rubyforge_project:
|
110
|
+
rubygems_version: 2.7.6
|
110
111
|
signing_key:
|
111
112
|
specification_version: 4
|
112
113
|
summary: An `RSpec` utility gem of custom matchers, shared contexts and examples
|