sus 0.24.5 → 0.24.6

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: 67342c168a6bdadd4fac4b58f2acf6a5e4cf5057de757b3fdd8a51f9e678ab84
4
- data.tar.gz: 84d9628daaf545f8eceb1fb0dd6e3a9920dd8a16f5dbc5c09288e2012d1db26f
3
+ metadata.gz: bd73d19653d8f343cbe51fb0f0f9a4657d33a4595a2221049b2ec64f8bfe51e6
4
+ data.tar.gz: f6403d891ec25bb6a2b7e3f2d60a385215480101c757966f7758823313f4b05f
5
5
  SHA512:
6
- metadata.gz: 6a7148c1023aad25cc26674a5d778619ed91abc9286240376b9295a3c9705a957c827dfccedf2e5df9787534602c9e6b79ac82f73676ed9365894b4fb8a24396
7
- data.tar.gz: aec658edbded84cb1e90d4defac4112ae74dd8e732c2a9d04c00bda7986fde88a8879a7bbc10a9bd7fe375487c64c85bafc73099605da93f1bad44b5f37a1cc7
6
+ metadata.gz: b9edf8b692a22a77a1461ad0dd3b47fea7286413730b47f30aa72c9116440c984eb30c6ac3d3b01378a079e1288eaeaa5581e0abd2af984655c7716788ed8df1
7
+ data.tar.gz: 951973bdda435c9c046af85f8cb762ca94502b617e1f08ce5ab0413a47de8a51fa3946ef78f112ad6e1342623def1299a62c1de184383324d0ea297c59cfbccc
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/sus/receive.rb CHANGED
@@ -21,7 +21,7 @@ module Sus
21
21
  end
22
22
 
23
23
  def print(output)
24
- output.write("receive ", :variable, @method.to_s, :reset, " ")
24
+ output.write("receive ", :variable, @method.to_s, :reset)
25
25
  end
26
26
 
27
27
  def with_arguments(predicate)
@@ -70,33 +70,37 @@ module Sus
70
70
  end
71
71
 
72
72
  def validate(mock, assertions, arguments, options, block)
73
- @arguments.call(assertions, arguments) if @arguments
74
- @options.call(assertions, options) if @options
75
- @block.call(assertions, block) if @block
73
+ return unless @arguments or @options or @block
74
+
75
+ assertions.nested(self) do |assertions|
76
+ @arguments.call(assertions, arguments) if @arguments
77
+ @options.call(assertions, options) if @options
78
+ @block.call(assertions, block) if @block
79
+ end
76
80
  end
77
81
 
78
82
  def call(assertions, subject)
79
83
  assertions.nested(self) do |assertions|
80
84
  mock = @base.mock(subject)
81
-
85
+
82
86
  called = 0
83
-
87
+
84
88
  if call_original?
85
89
  mock.before(@method) do |*arguments, **options, &block|
86
90
  called += 1
87
-
91
+
88
92
  validate(mock, assertions, arguments, options, block)
89
93
  end
90
94
  else
91
95
  mock.replace(@method) do |*arguments, **options, &block|
92
96
  called += 1
93
-
97
+
94
98
  validate(mock, assertions, arguments, options, block)
95
-
99
+
96
100
  next @returning
97
101
  end
98
102
  end
99
-
103
+
100
104
  if @times
101
105
  assertions.defer do
102
106
  @times.call(assertions, called)
@@ -120,7 +124,7 @@ module Sus
120
124
 
121
125
  def call(assertions, subject)
122
126
  assertions.nested(self) do |assertions|
123
- @predicate.call(assertions, subject)
127
+ Expect.new(assertions, subject).to(@predicate)
124
128
  end
125
129
  end
126
130
  end
@@ -136,7 +140,7 @@ module Sus
136
140
 
137
141
  def call(assertions, subject)
138
142
  assertions.nested(self) do |assertions|
139
- @predicate.call(assertions, subject)
143
+ Expect.new(assertions, subject).to(@predicate)
140
144
  end
141
145
  end
142
146
  end
data/lib/sus/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2023, by Samuel Williams.
5
5
 
6
6
  module Sus
7
- VERSION = "0.24.5"
7
+ VERSION = "0.24.6"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.5
4
+ version: 0.24.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -38,7 +38,7 @@ cert_chain:
38
38
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
39
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
40
  -----END CERTIFICATE-----
41
- date: 2024-01-26 00:00:00.000000000 Z
41
+ date: 2024-02-08 00:00:00.000000000 Z
42
42
  dependencies: []
43
43
  description:
44
44
  email:
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubygems_version: 3.5.5
124
+ rubygems_version: 3.5.3
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: A fast and scalable test runner.
metadata.gz.sig CHANGED
Binary file