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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '002180c2b61102ae17dfa6814f04d8bbc8ffbaabcdf9eb2ee3659663881da1c1'
4
- data.tar.gz: '0481509d19957f9be6ed46f70ef42c6c905bac506bcbf9af7e6f0e6573913e47'
3
+ metadata.gz: 42a14bf8bcb2e23975ba055336890850fb39aaefed897b84e3f0f776e23c4416
4
+ data.tar.gz: 36e90cd7e042d37b2724f710340b4c18135df24477943f0c82a0bc50144c19c6
5
5
  SHA512:
6
- metadata.gz: aa434f2ae76a8c062d601af815cd000e00880c74d87710be827b9e62983e82d72b57db2ffac52f9c20993e64efbd30c406bbffa9645eb1ec2e1585cdedae630f
7
- data.tar.gz: 58ad6ba8b887d4032394884e0974d1ebad253463af1c4dc40aede8b504f2b24ae2b2149c264ed2dff96581c19bf46a66e7808ceda4ab3a5dffa9f4f86bcab4b7
6
+ metadata.gz: a71cd343bf7c29d6dc89e3d88366141ebc6ad47372a8c1e6b3a9f5617d2c7e6bc3148fdde78477b33ddd7cda7b648ad2329ba568af05d5be89f7e4786b556fbf
7
+ data.tar.gz: 0c75e90c614b892db4de02e4086bba9ea46887df4f1ae711915b2b21f05e84b31c905ca3534e3b8f9641440a11ec45feb47592e272ea6989d123bbc40696b018
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.8.6
4
+
5
+ Fixed `WrongScopeError` when calling the `Toolbelt` concern.
6
+
3
7
  ## 2.8.5
4
8
 
5
9
  Fixed remaining direct references to `SleepingKingStudios::Tools` methods.
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.1 through 3.4
27
+ - Ruby (MRI) 3.4 through 4.0
28
28
  - RSpec versions 3.9 through 3.13
29
- - ActiveModel versions 6.1 through 8.0
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, &block)
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, &block) if block_given?
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, &block)
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
- &block
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
- &block
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(&block)
119
+ wrapped_example.example.instance_exec(&)
120
120
  else
121
121
  constant_value
122
122
  end
@@ -1,25 +1,28 @@
1
- # lib/rspec/sleeping_king_studios/concerns/toolbelt.rb
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, exposing
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 # class method tools
19
- end # module
19
+ end
20
+ end
20
21
 
22
+ # @return [SleepingKingStudios::Tools::Toolbelt] the shared toolbelt
23
+ # instance.
21
24
  def tools
22
- @tools ||= self.class.tools
23
- end # method tools
24
- end # module
25
- end # module
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
- class RSpec::Core::Configuration # rubocop:disable Style/Documentation
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
- # @param method_name [String, Symbol] the name of the method to call.
10
- # @param arguments [Array] the arguments to pass to the method.
11
- # @param keywords [Hash] the keywords to pass to the method.
12
- # @param deferred_example_group [Deferred::Examples] the deferred example
13
- # group defining the deferred call.
14
- # @param block [Proc] the block to pass to the method.
15
- def initialize(
16
- method_name,
17
- *arguments,
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
- # @param method_name [String, Symbol] the name of the method to call.
10
- # @param arguments [Array] the arguments to pass to the method.
11
- # @param keywords [Hash] the keywords to pass to the method.
12
- # @param deferred_example_group [Deferred::Examples] the deferred example
13
- # group defining the deferred call.
14
- # @param block [Proc] the block to pass to the method.
15
- def initialize(
16
- method_name,
17
- *arguments,
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
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'set'
4
-
5
3
  require 'rspec/sleeping_king_studios/deferred/call'
6
4
  require 'rspec/sleeping_king_studios/deferred/calls'
7
5
 
@@ -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
- &block
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
- &block
64
+ &
65
65
  )
66
66
 
67
67
  nil
@@ -13,7 +13,7 @@ module RSpec
13
13
  # Minor version.
14
14
  MINOR = 8
15
15
  # Patch version.
16
- PATCH = 5
16
+ PATCH = 6
17
17
  # Prerelease version.
18
18
  PRERELEASE = nil
19
19
  # Build metadata.
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.5
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.1'
183
+ version: '3.2'
184
184
  - - "<"
185
185
  - !ruby/object:Gem::Version
186
186
  version: '5'