stoplight 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stoplight/light/runnable.rb +11 -0
- data/lib/stoplight/version.rb +1 -1
- data/spec/stoplight/light/runnable_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbfed26c7b63f56e88cd970d5db820022a89d689570cd4e98168b7226d718791
|
4
|
+
data.tar.gz: 9206b2c2a66e78d39f37e7932fc95faaf850a2cc54d024eab2a2d90dc14396b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34d477b3b8e0c6e9b34a0a1ea7e0e6fab4950601d914407063a113f019b9e4a7420b4b291f76702e326b41f3b7cd780adb55f9c2df28bd659c9be7d384af35b4
|
7
|
+
data.tar.gz: ab49c8f6cac59358b78807fa82e88e8ee3cec5c668dad2f6cc0ca8183507dc64373f611c23b83dce4d2d5958f176d6c447e796a9137e87a165b0cabd12b7dc7c
|
@@ -52,7 +52,18 @@ module Stoplight
|
|
52
52
|
fallback.call(nil)
|
53
53
|
end
|
54
54
|
|
55
|
+
MISSING_BLOCK_ERROR = <<~ERROR
|
56
|
+
Oops! An error occurred while executing the `Stoplight#run` method. This happened because you
|
57
|
+
didn't pass a code block to the `Stoplight()` function. You can fix this issue this way:
|
58
|
+
|
59
|
+
Stoplight('test-light') { ... }.run
|
60
|
+
|
61
|
+
For more details and examples, please refer to the documentation https://github.com/bolshakov/stoplight/tree/release/v3.x
|
62
|
+
ERROR
|
63
|
+
|
55
64
|
def run_code(on_success, on_failure)
|
65
|
+
raise ArgumentError, MISSING_BLOCK_ERROR unless code
|
66
|
+
|
56
67
|
result = code.call
|
57
68
|
failures = clear_failures
|
58
69
|
on_success&.call(failures)
|
data/lib/stoplight/version.rb
CHANGED
@@ -285,5 +285,13 @@ RSpec.describe Stoplight::Light::Runnable do
|
|
285
285
|
end
|
286
286
|
end
|
287
287
|
end
|
288
|
+
|
289
|
+
context 'when the code block is missing' do
|
290
|
+
subject { Stoplight::Light.new(name) }
|
291
|
+
|
292
|
+
it 'raises an ArgumentError error' do
|
293
|
+
expect { subject.run }.to raise_error(ArgumentError)
|
294
|
+
end
|
295
|
+
end
|
288
296
|
end
|
289
297
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stoplight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Desautels
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-08-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: redlock
|