diff --git a/common_pr4119.patch b/common_pr4119.patch deleted file mode 100644 index cb936c975a..0000000000 --- a/common_pr4119.patch +++ /dev/null @@ -1,88 +0,0 @@ -diff --git a/oc-chef-pedant/lib/pedant/rspec/common.rb b/oc-chef-pedant/lib/pedant/rspec/common.rb -index 1b684fb38..a14374fdc 100755 ---- a/oc-chef-pedant/lib/pedant/rspec/common.rb -+++ b/oc-chef-pedant/lib/pedant/rspec/common.rb -@@ -326,7 +326,9 @@ module Pedant - # - Prefixes "pedant_" for the name - # - Appends a suffix unique for the entire Pedant run - # - Useful for things like names for roles, nodes, etc. -- let(:unique_name) { ->(name) { "pedant_#{name}_#{pedant_suffix}" } } -+ def unique_name(name) -+ "pedant_#{name}_#{pedant_suffix}" -+ end - - # Helper method for helper methods; useful for ensuring that - # parameters are the correct data type -@@ -338,11 +340,9 @@ module Pedant - - # Helper method for helper methods; useful for ensuring that - # parameters are the correct data type -- let(:should_be_string) do -- ->(data) do -- if data.class != String -- raise "Data needs to be a string; you passed in a #{data.class}: #{data}" -- end -+ def should_be_string(data) -+ if data.class != String -+ raise "Data needs to be a string; you passed in a #{data.class}: #{data}" - end - end - -@@ -421,27 +421,29 @@ module Pedant - # These instance-level helpers are accessible from examples, let blocks, - # before(:each), and after(:each). In before(:all)/after(:all) blocks, use - # Pedant::Config.pedant_platform directly to avoid RSpec scope issues. -- let (:platform) { Pedant::Config.pedant_platform } -- -- let (:api_url) { ->(path_fragment) { Pedant::Config.pedant_platform.api_url(path_fragment) } } -+ def platform -+ Pedant::Config.pedant_platform -+ end - -- # Given a response object, verify the HTTP status is in the -- # 200-ish success range and raise an error if it is not. This -- # is intended to be used in helper/util modules where we want -- # to ensure the success of setup and teardown operations. -- let (:ensure_2xx) do -- ->(response) do -- if response.code > 299 -- raise "bad response code #{response.code} in response: #{response}" -- end -- response -- end -+ def api_url(path_fragment) -+ Pedant::Config.pedant_platform.api_url(path_fragment) - end - - ## TODO: Remove this method; we probably don't need to access it directly - def server - platform - end -+ # Given a response object, verify the HTTP status is in the -+ # 200-ish success range and raise an error if it is not. This -+ # is intended to be used in helper/util modules where we want -+ # to ensure the success of setup and teardown operations. -+ def ensure_2xx(response) -+ if response.code > 299 -+ raise "bad response code #{response.code} in response: #{response}" -+ end -+ -+ response -+ end - - ################################################################################ - # Logging -@@ -529,11 +531,11 @@ module Pedant - # by parameterizing on the container name. - - def add_chef_object(container_name, requestor, object_json) -- post(api_url.call("/#{container_name}"), requestor, payload: object_json) -+ post(api_url("/#{container_name}"), requestor, payload: object_json) - end - - def delete_chef_object(container_name, requestor, object_name) -- delete(api_url.call("/#{container_name}/#{object_name}"), requestor) -+ delete(api_url("/#{container_name}/#{object_name}"), requestor) - end - - # DSL helpers diff --git a/oc-chef-pedant/lib/pedant/concern.rb b/oc-chef-pedant/lib/pedant/concern.rb index abf7d95db1..6d96908196 100644 --- a/oc-chef-pedant/lib/pedant/concern.rb +++ b/oc-chef-pedant/lib/pedant/concern.rb @@ -22,35 +22,21 @@ def self.extended(base) base.instance_variable_set(:@_dependencies, []) end - # This method is called in two ways: - # 1. included do ... end - to register a block to be executed when the module is included - # 2. included(base) - called by Ruby when the module is actually included (via super) + # Evaluate given block in context of base class, so that you can write class macros here. + # When base is nil, stores the block to be executed later when the module is included. + # When base is provided, calls super to maintain Ruby's module inclusion chain. def included(base = nil, &block) - if block_given? - # Store the block to be executed later when module is included + if base.nil? @_included_block = block else - # This is the actual inclusion - super will call Module#included - super if base + super end end def append_features(base) - # First, add the module's features (methods, constants, etc.) super - - # Then execute any included block in the context of the base class - # instance_exec evaluates the block with self as base, and passes base as arg - # This supports both: included do ... end AND included do |base| ... end - if instance_variable_defined?(:@_included_block) && @_included_block - base.instance_exec(base, &@_included_block) - end - - # Automatically extend base with ClassMethods if it exists - # This is the key feature of ActiveSupport::Concern - if const_defined?(:ClassMethods) - base.extend const_get(:ClassMethods) - end + base.class_eval(&@_included_block) if instance_variable_defined?(:@_included_block) + base.extend const_get(:ClassMethods) if const_defined?(:ClassMethods) end end end diff --git a/scripts/bk_tests/chef_zero-Gemfile.lock b/scripts/bk_tests/chef_zero-Gemfile.lock deleted file mode 100644 index 0a7ab83a19..0000000000 --- a/scripts/bk_tests/chef_zero-Gemfile.lock +++ /dev/null @@ -1,143 +0,0 @@ -GIT - remote: https://github.com/chef/chef-zero.git - revision: b174ed09388129f36f508e806d7fbe39841ea828 - branch: main - specs: - chef-zero (15.0.27) - ffi-yajl (>= 2.2, < 4.0) - hashie (>= 2.0, < 6.0) - mixlib-log (>= 2.0, < 4.0) - rack (~> 3.1, >= 3.1.16) - rackup (~> 2.2, >= 2.2.1) - unf_ext (~> 0.0.8) - uuidtools (~> 2.1) - webrick - -GIT - remote: https://github.com/chef/rest-client - revision: 4725c8b5ae09b3f6b968831beae27503f1261ea9 - branch: jfm/ucrt_update1 - specs: - rest-client (2.1.0) - base64 - ffi (>= 1.15.5, < 1.18.0) - http-accept (~> 2.1.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) - -PATH - remote: C:/localrepo/chef-server/oc-chef-pedant - specs: - oc-chef-pedant (2.2.0) - addressable - chef-utils (>= 16.17.51) - erubis (~> 2.7) - mixlib-authentication (> 1.4, < 4.0) - mixlib-config (>= 2, < 4) - mixlib-shellout (>= 1.1) - net-http-spy (~> 0.2) - rest-client (>= 1.6) - rspec (~> 3.2) - rspec-rerun (~> 1.0) - rspec_junit_formatter (~> 0.2) - uuidtools (~> 2.0) - -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - base64 (0.3.0) - binding_of_caller (1.0.1) - debug_inspector (>= 1.2.0) - byebug (12.0.0) - chef-utils (18.8.54) - concurrent-ruby - coderay (1.1.3) - concurrent-ruby (1.3.5) - debug_inspector (1.2.0) - diff-lcs (1.6.2) - domain_name (0.6.20240107) - erubis (2.7.0) - ffi (1.17.2-x64-mingw-ucrt) - ffi-win32-extensions (1.0.4) - ffi - ffi-yajl (3.0.0) - libyajl2 (>= 1.2) - hashie (5.0.0) - http-accept (2.1.1) - http-cookie (1.1.0) - domain_name (~> 0.5) - libyajl2 (2.1.0) - logger (1.7.0) - method_source (1.1.0) - mime-types (3.7.0) - logger - mime-types-data (~> 3.2025, >= 3.2025.0507) - mime-types-data (3.2025.0924) - mixlib-authentication (3.0.10) - mixlib-config (3.0.27) - tomlrb - mixlib-log (3.2.3) - ffi (>= 1.15.5) - mixlib-shellout (3.3.9-x64-mingw-ucrt) - chef-utils - ffi-win32-extensions (~> 1.0.3) - win32-process (~> 0.9) - wmi-lite (~> 1.0) - net-http-spy (0.2.1) - netrc (0.11.0) - pry (0.15.2) - coderay (~> 1.1) - method_source (~> 1.0) - pry-byebug (3.11.0) - byebug (~> 12.0) - pry (>= 0.13, < 0.16) - pry-stack_explorer (0.6.1) - binding_of_caller (~> 1.0) - pry (~> 0.13) - public_suffix (6.0.2) - rack (3.2.4) - rackup (2.2.1) - rack (>= 3) - rake (13.3.1) - rspec (3.13.2) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.6) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.5) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-mocks (3.13.7) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-rerun (1.1.0) - rspec (~> 3.0) - rspec-support (3.13.6) - rspec_junit_formatter (0.6.0) - rspec-core (>= 2, < 4, != 2.12.0) - tomlrb (2.0.3) - unf_ext (0.0.9.1-x64-mingw-ucrt) - uuidtools (2.2.0) - webrick (1.9.1) - win32-process (0.10.0) - ffi (>= 1.0.0) - wmi-lite (1.0.7) - -PLATFORMS - x64-mingw-ucrt - -DEPENDENCIES - chef-zero! - oc-chef-pedant! - pry - pry-byebug - pry-stack_explorer - rake - rest-client! - -BUNDLED WITH - 2.5.23