rspec-sleeping_king_studios 2.8.5 → 2.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/lib/rspec/sleeping_king_studios/concerns/example_constants.rb +6 -6
- data/lib/rspec/sleeping_king_studios/concerns/toolbelt.rb +12 -9
- data/lib/rspec/sleeping_king_studios/configuration.rb +1 -1
- data/lib/rspec/sleeping_king_studios/deferred/calls/example.rb +9 -14
- data/lib/rspec/sleeping_king_studios/deferred/calls/example_group.rb +9 -14
- data/lib/rspec/sleeping_king_studios/deferred/calls/hook.rb +0 -2
- data/lib/rspec/sleeping_king_studios/deferred/dsl/example_constants.rb +2 -2
- data/lib/rspec/sleeping_king_studios/version.rb +1 -1
- 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: 42a14bf8bcb2e23975ba055336890850fb39aaefed897b84e3f0f776e23c4416
|
|
4
|
+
data.tar.gz: 36e90cd7e042d37b2724f710340b4c18135df24477943f0c82a0bc50144c19c6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a71cd343bf7c29d6dc89e3d88366141ebc6ad47372a8c1e6b3a9f5617d2c7e6bc3148fdde78477b33ddd7cda7b648ad2329ba568af05d5be89f7e4786b556fbf
|
|
7
|
+
data.tar.gz: 0c75e90c614b892db4de02e4086bba9ea46887df4f1ae711915b2b21f05e84b31c905ca3534e3b8f9641440a11ec45feb47592e272ea6989d123bbc40696b018
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -24,9 +24,9 @@ inherit_gem:
|
|
|
24
24
|
|
|
25
25
|
RSpec::SleepingKingStudios is tested against the following dependencies:
|
|
26
26
|
|
|
27
|
-
- Ruby (MRI) 3.
|
|
27
|
+
- Ruby (MRI) 3.4 through 4.0
|
|
28
28
|
- RSpec versions 3.9 through 3.13
|
|
29
|
-
- ActiveModel versions
|
|
29
|
+
- ActiveModel versions 7.1 through 8.1
|
|
30
30
|
|
|
31
31
|
### Documentation
|
|
32
32
|
|
|
@@ -10,14 +10,14 @@ module RSpec::SleepingKingStudios::Concerns
|
|
|
10
10
|
|
|
11
11
|
class << self
|
|
12
12
|
# @api private
|
|
13
|
-
def define_class(class_name:, example:, base_class: nil, &
|
|
13
|
+
def define_class(class_name:, example:, base_class: nil, &)
|
|
14
14
|
klass = Class.new(resolve_base_class(base_class))
|
|
15
15
|
|
|
16
16
|
klass.define_singleton_method(:name) { class_name }
|
|
17
17
|
klass.singleton_class.send(:alias_method, :inspect, :name)
|
|
18
18
|
klass.singleton_class.send(:alias_method, :to_s, :name)
|
|
19
19
|
|
|
20
|
-
example.instance_exec(klass, &
|
|
20
|
+
example.instance_exec(klass, &) if block_given?
|
|
21
21
|
|
|
22
22
|
klass
|
|
23
23
|
end
|
|
@@ -94,7 +94,7 @@ module RSpec::SleepingKingStudios::Concerns
|
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
96
|
|
|
97
|
-
def example_class(class_name, base_class = nil, &
|
|
97
|
+
def example_class(class_name, base_class = nil, &)
|
|
98
98
|
class_name = class_name.to_s if class_name.is_a?(Symbol)
|
|
99
99
|
|
|
100
100
|
example_constant(class_name) do
|
|
@@ -102,7 +102,7 @@ module RSpec::SleepingKingStudios::Concerns
|
|
|
102
102
|
base_class:,
|
|
103
103
|
class_name:,
|
|
104
104
|
example: self,
|
|
105
|
-
&
|
|
105
|
+
&
|
|
106
106
|
)
|
|
107
107
|
end
|
|
108
108
|
end
|
|
@@ -111,12 +111,12 @@ module RSpec::SleepingKingStudios::Concerns
|
|
|
111
111
|
qualified_name,
|
|
112
112
|
constant_value = DEFAULT_VALUE,
|
|
113
113
|
force: false,
|
|
114
|
-
&
|
|
114
|
+
&
|
|
115
115
|
)
|
|
116
116
|
around(:example) do |wrapped_example|
|
|
117
117
|
resolved_value =
|
|
118
118
|
if constant_value == DEFAULT_VALUE && block_given?
|
|
119
|
-
wrapped_example.example.instance_exec(&
|
|
119
|
+
wrapped_example.example.instance_exec(&)
|
|
120
120
|
else
|
|
121
121
|
constant_value
|
|
122
122
|
end
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'sleeping_king_studios/tools/toolbox/mixin'
|
|
4
4
|
|
|
5
5
|
require 'rspec/sleeping_king_studios/concerns'
|
|
6
6
|
|
|
7
7
|
module RSpec::SleepingKingStudios::Concerns
|
|
8
|
-
# Defines ::tools and #tools methods for example groups and examples
|
|
9
|
-
# an instance of SleepingKingStudios::Tools::Toolbelt.
|
|
8
|
+
# Defines ::tools and #tools methods for example groups and examples.
|
|
10
9
|
module Toolbelt
|
|
11
10
|
extend SleepingKingStudios::Tools::Toolbox::Mixin
|
|
12
11
|
|
|
13
12
|
# Class methods to define when including
|
|
14
13
|
# RSpec::SleepingKingStudios::Concerns::Toolbelt in a class.
|
|
15
14
|
module ClassMethods
|
|
15
|
+
# @return [SleepingKingStudios::Tools::Toolbelt] the shared toolbelt
|
|
16
|
+
# instance.
|
|
16
17
|
def tools
|
|
17
18
|
@tools ||= SleepingKingStudios::Tools::Toolbelt.instance
|
|
18
|
-
end
|
|
19
|
-
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
20
21
|
|
|
22
|
+
# @return [SleepingKingStudios::Tools::Toolbelt] the shared toolbelt
|
|
23
|
+
# instance.
|
|
21
24
|
def tools
|
|
22
|
-
@tools ||=
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
25
|
+
@tools ||= SleepingKingStudios::Tools::Toolbelt.instance
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -150,7 +150,7 @@ module RSpec::SleepingKingStudios
|
|
|
150
150
|
end
|
|
151
151
|
end
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
RSpec::Core::Configuration.class_eval do
|
|
154
154
|
# Get or set the configuration options for RSpec::SleepingKingStudios.
|
|
155
155
|
def sleeping_king_studios(&)
|
|
156
156
|
@sleeping_king_studios ||= RSpec::SleepingKingStudios::Configuration.new
|
|
@@ -6,20 +6,15 @@ require 'rspec/sleeping_king_studios/deferred/calls'
|
|
|
6
6
|
module RSpec::SleepingKingStudios::Deferred::Calls
|
|
7
7
|
# Value object representing a deferred RSpec example.
|
|
8
8
|
class Example < RSpec::SleepingKingStudios::Deferred::Call
|
|
9
|
-
# @
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
deferred_example_group: nil,
|
|
19
|
-
**keywords,
|
|
20
|
-
&block
|
|
21
|
-
)
|
|
22
|
-
super(method_name, *arguments, **keywords, &block)
|
|
9
|
+
# @overload initialize(method_name, *arguments, deferred_example_group: nil, **keywords, &block)
|
|
10
|
+
# @param method_name [String, Symbol] the name of the method to call.
|
|
11
|
+
# @param arguments [Array] the arguments to pass to the method.
|
|
12
|
+
# @param keywords [Hash] the keywords to pass to the method.
|
|
13
|
+
# @param deferred_example_group [Deferred::Examples] the deferred example
|
|
14
|
+
# group defining the deferred call.
|
|
15
|
+
# @param block [Proc] the block to pass to the method.
|
|
16
|
+
def initialize(method_name, *, deferred_example_group: nil, **, &)
|
|
17
|
+
super(method_name, *, **, &)
|
|
23
18
|
|
|
24
19
|
@deferred_example_group = deferred_example_group
|
|
25
20
|
end
|
|
@@ -6,20 +6,15 @@ require 'rspec/sleeping_king_studios/deferred/calls'
|
|
|
6
6
|
module RSpec::SleepingKingStudios::Deferred::Calls
|
|
7
7
|
# Value object representing a deferred RSpec example group.
|
|
8
8
|
class ExampleGroup < RSpec::SleepingKingStudios::Deferred::Call
|
|
9
|
-
# @
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
deferred_example_group: nil,
|
|
19
|
-
**keywords,
|
|
20
|
-
&block
|
|
21
|
-
)
|
|
22
|
-
super(method_name, *arguments, **keywords, &block)
|
|
9
|
+
# @overload initialize(method_name, *arguments, deferred_example_group: nil, **keywords, &block)
|
|
10
|
+
# @param method_name [String, Symbol] the name of the method to call.
|
|
11
|
+
# @param arguments [Array] the arguments to pass to the method.
|
|
12
|
+
# @param keywords [Hash] the keywords to pass to the method.
|
|
13
|
+
# @param deferred_example_group [Deferred::Examples] the deferred example
|
|
14
|
+
# group defining the deferred call.
|
|
15
|
+
# @param block [Proc] the block to pass to the method.
|
|
16
|
+
def initialize(method_name, *, deferred_example_group: nil, **, &)
|
|
17
|
+
super(method_name, *, **, &)
|
|
23
18
|
|
|
24
19
|
@deferred_example_group = deferred_example_group
|
|
25
20
|
end
|
|
@@ -53,7 +53,7 @@ module RSpec::SleepingKingStudios::Deferred::Dsl # rubocop:disable Style/Documen
|
|
|
53
53
|
qualified_name,
|
|
54
54
|
constant_value = nil,
|
|
55
55
|
force: false,
|
|
56
|
-
&
|
|
56
|
+
&
|
|
57
57
|
)
|
|
58
58
|
deferred_calls <<
|
|
59
59
|
RSpec::SleepingKingStudios::Deferred::Call.new(
|
|
@@ -61,7 +61,7 @@ module RSpec::SleepingKingStudios::Deferred::Dsl # rubocop:disable Style/Documen
|
|
|
61
61
|
qualified_name,
|
|
62
62
|
*(constant_value.nil? ? [] : [constant_value]),
|
|
63
63
|
force:,
|
|
64
|
-
&
|
|
64
|
+
&
|
|
65
65
|
)
|
|
66
66
|
|
|
67
67
|
nil
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-sleeping_king_studios
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.
|
|
4
|
+
version: 2.8.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rob "Merlin" Smith
|
|
@@ -180,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
180
180
|
requirements:
|
|
181
181
|
- - ">="
|
|
182
182
|
- !ruby/object:Gem::Version
|
|
183
|
-
version: '3.
|
|
183
|
+
version: '3.2'
|
|
184
184
|
- - "<"
|
|
185
185
|
- !ruby/object:Gem::Version
|
|
186
186
|
version: '5'
|