rspice 0.16.3 → 0.17.4
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 +10 -6
- data/lib/rspice/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 638b26ccc3515786475a25b823ca674505bde2f747fcbfc215d99b03a1162a99
|
4
|
+
data.tar.gz: 4ae0f80f098f8b14fdac29da7b6739a422822f0a98610d342875e14c2282e81e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 485e182c1165c1598f87e753955e8775889388bea48c5fd4dd45ab05038f5881b0f4474d858eb04a182af4eef769d62867ffcca6f955f2016ba3efda4069f9cf
|
7
|
+
data.tar.gz: 7d311fe03a732c855660e99f7f9ac2e11a2fd880132b84148f1134a7001204f9c7ad4d4137f950ecd399aa0056f5d06f71d35bf072d5af661150006416242b4a
|
@@ -34,9 +34,9 @@
|
|
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,
|
37
|
+
call_class.public_send(method, *arguments, &block)
|
38
38
|
else
|
39
|
-
call_class.public_send(method, *arguments
|
39
|
+
call_class.public_send(method, *arguments)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -48,7 +48,11 @@ 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)
|
51
|
+
let(:arguments) do
|
52
|
+
Array.new(argument_arity) { double }.tap do |array|
|
53
|
+
array << options if options.present?
|
54
|
+
end
|
55
|
+
end
|
52
56
|
let(:options) { option_keys.each_with_object({}) { |key, hash| hash[key] = Faker::Lorem.word } }
|
53
57
|
let(:block) { -> {} }
|
54
58
|
let(:instance) { instance_double(test_class) }
|
@@ -58,9 +62,9 @@ RSpec.shared_examples_for "a class pass method" do |method|
|
|
58
62
|
allow(instance).to receive(method).and_return(output)
|
59
63
|
|
60
64
|
if accepts_block?
|
61
|
-
allow(test_class).to receive(:new).with(*arguments,
|
62
|
-
elsif arguments.any?
|
63
|
-
allow(test_class).to receive(:new).with(*arguments
|
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)
|
64
68
|
else
|
65
69
|
allow(test_class).to receive(:new).with(no_args).and_return(instance)
|
66
70
|
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.17.4
|
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-
|
14
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
|
-
rubygems_version: 3.0.
|
109
|
+
rubygems_version: 3.0.6
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: An `RSpec` utility gem of custom matchers, shared contexts and examples
|