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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cd38fff33eef0008f68d802fc0aa97f98e54623e295e46101a9936b480f92c9
4
- data.tar.gz: '06009e0975ebb991c25c594fa9c585e67eeadc09e2866f814d89b63bb079ee7d'
3
+ metadata.gz: 638b26ccc3515786475a25b823ca674505bde2f747fcbfc215d99b03a1162a99
4
+ data.tar.gz: 4ae0f80f098f8b14fdac29da7b6739a422822f0a98610d342875e14c2282e81e
5
5
  SHA512:
6
- metadata.gz: 5d4a4454e8b0c83d0e7cb6fc2187ec0538e40270af56a2ea4210154b825b7016c9395c4e23852f85cd433c369569e9b1f4e3cbc356e23b46d5c741c511919696
7
- data.tar.gz: 59f27b2f52b9969cf91edbf509be742fca7fb71a3c040d58662f49a38e5775668bb2976def0b6a802c9d341be35cacba20d895d36f581d016bf731e0d48f5024
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, **options, &block)
37
+ call_class.public_send(method, *arguments, &block)
38
38
  else
39
- call_class.public_send(method, *arguments, **options)
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) { Array.new(argument_arity) { double } }
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, **options, &block).and_return(instance)
62
- elsif arguments.any? || options.any?
63
- allow(test_class).to receive(:new).with(*arguments, **options).and_return(instance)
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Rspice
4
4
  # This constant is managed by spicerack
5
- VERSION = "0.16.3"
5
+ VERSION = "0.17.4"
6
6
  end
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.16.3
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-09-19 00:00:00.000000000 Z
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.3
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