diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index cd1b7f85..671c3e60 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -48,3 +48,17 @@ It can be startet on a second shell: # Integration environment (TBD) #TODO: Setup a environment with VMs to have a real puppetserver and puppetdb for testing. + +# Regnerate gemset + +If you happen to delete the Gemfile.lock and regenerate it, do not forget about the supported platforms + +```bash +bundle lock --add-platform ruby x86_64-linux x86_64-darwin-22 arm64-darwin +``` + +# Update gemset + +```bash +bundle update +``` diff --git a/Gemfile.lock b/Gemfile.lock index 8aba261e..95d37415 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,75 +2,75 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.6) - actioncable (7.0.6) - actionpack (= 7.0.6) - activesupport (= 7.0.6) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.6) - actionpack (= 7.0.6) - activejob (= 7.0.6) - activerecord (= 7.0.6) - activestorage (= 7.0.6) - activesupport (= 7.0.6) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.6) - actionpack (= 7.0.6) - actionview (= 7.0.6) - activejob (= 7.0.6) - activesupport (= 7.0.6) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.6) - actionview (= 7.0.6) - activesupport (= 7.0.6) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.6) - actionpack (= 7.0.6) - activerecord (= 7.0.6) - activestorage (= 7.0.6) - activesupport (= 7.0.6) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.6) - activesupport (= 7.0.6) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.6) - activesupport (= 7.0.6) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.6) - activesupport (= 7.0.6) - activerecord (7.0.6) - activemodel (= 7.0.6) - activesupport (= 7.0.6) - activestorage (7.0.6) - actionpack (= 7.0.6) - activejob (= 7.0.6) - activerecord (= 7.0.6) - activesupport (= 7.0.6) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.6) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.4) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - async (2.6.2) + async (2.6.4) console (~> 1.10) fiber-annotation io-event (~> 1.1) @@ -86,12 +86,13 @@ GEM async-http-faraday (0.12.0) async-http (~> 0.42) faraday - async-io (1.35.0) + async-io (1.36.0) async async-pool (0.4.0) async (>= 1.25) - autoprefixer-rails (10.4.13.0) + autoprefixer-rails (10.4.15.0) execjs (~> 2) + base64 (0.1.1) bcrypt (3.1.19) bindex (0.8.1) bootstrap (4.6.2) @@ -117,9 +118,9 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) connection_pool (2.4.1) - console (1.17.2) + console (1.23.2) fiber-annotation fiber-local crass (1.0.6) @@ -131,18 +132,20 @@ GEM diffy (3.4.2) docile (1.4.0) erubi (1.12.0) - execjs (2.8.1) - facter (4.3.0) + execjs (2.9.1) + facter (4.4.3) hocon (~> 1.3) + sys-filesystem (~> 1.3) thor (>= 1.0.1, < 2.0) factory_bot (6.2.1) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - faker (3.2.0) + faker (3.2.1) i18n (>= 1.8.11, < 2) - faraday (2.7.9) + faraday (2.7.11) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-http-cache (2.5.0) @@ -170,13 +173,13 @@ GEM octokit (~> 4.6) rainbow (>= 2.2.1) rake (>= 10.0) - globalid (1.1.0) - activesupport (>= 5.0) - google-protobuf (3.23.3) - google-protobuf (3.23.3-x86_64-darwin) - google-protobuf (3.23.3-x86_64-linux) - hiera (3.12.0) - hiera-eyaml (3.3.0) + globalid (1.2.1) + activesupport (>= 6.1) + google-protobuf (3.24.3) + google-protobuf (3.24.3-arm64-darwin) + google-protobuf (3.24.3-x86_64-darwin) + google-protobuf (3.24.3-x86_64-linux) + hiera-eyaml (3.4.0) highline optimist highline (2.1.0) @@ -189,13 +192,15 @@ GEM importmap-rails (1.2.1) actionpack (>= 6.0.0) railties (>= 6.0.0) - io-event (1.2.2) + io-event (1.3.2) jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.6.3) + language_server-protocol (3.17.0.3) libv8-node (18.16.0.0) + libv8-node (18.16.0.0-arm64-darwin) libv8-node (18.16.0.0-x86_64-darwin) libv8-node (18.16.0.0-x86_64-linux) listen (3.8.0) @@ -213,14 +218,14 @@ GEM marcel (1.0.2) matrix (0.4.2) method_source (1.0.0) - mini_mime (1.1.2) - mini_portile2 (2.8.2) + mini_mime (1.1.5) + mini_portile2 (2.8.4) mini_racer (0.8.0) libv8-node (~> 18.16.0.0) - minitest (5.18.1) + minitest (5.20.0) multi_json (1.15.0) multi_xml (0.6.0) - net-imap (0.3.6) + net-imap (0.3.7) date net-protocol net-ldap (0.18.0) @@ -231,17 +236,19 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.9) - nokogiri (1.15.2) + nokogiri (1.15.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.2-x86_64-darwin) + nokogiri (1.15.4-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) + nokogiri (1.15.4-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) sawyer (~> 0.9) - optimist (3.0.1) + optimist (3.1.0) parallel (1.23.0) parser (3.2.2.3) ast (~> 2.4.1) @@ -254,64 +261,62 @@ GEM protocol-http2 (0.15.1) protocol-hpack (~> 1.4) protocol-http (~> 0.18) - public_suffix (5.0.1) + public_suffix (5.0.3) puma (6.3.1) nio4r (~> 2.0) - puppet (7.23.0) - concurrent-ruby (~> 1.0, < 1.2.0) + puppet (8.2.0) + concurrent-ruby (~> 1.0) deep_merge (~> 1.0) - facter (> 2.0.1, < 5) - fast_gettext (>= 1.1, < 3) - hiera (>= 3.2.1, < 4) + facter (>= 4.3.0, < 5) + fast_gettext (>= 2.1, < 3) locale (~> 2.1) - multi_json (~> 1.10) + multi_json (~> 1.13) puppet-resource_api (~> 1.5) scanf (~> 1.0) semantic_puppet (~> 1.0) - puppet (7.23.0-universal-darwin) + puppet (8.2.0-universal-darwin) CFPropertyList (~> 2.2) - concurrent-ruby (~> 1.0, < 1.2.0) + concurrent-ruby (~> 1.0) deep_merge (~> 1.0) - facter (> 2.0.1, < 5) - fast_gettext (>= 1.1, < 3) - hiera (>= 3.2.1, < 4) + facter (>= 4.3.0, < 5) + fast_gettext (>= 2.1, < 3) locale (~> 2.1) - multi_json (~> 1.10) + multi_json (~> 1.13) puppet-resource_api (~> 1.5) scanf (~> 1.0) semantic_puppet (~> 1.0) - puppet-resource_api (1.8.14) + puppet-resource_api (1.9.0) hocon (>= 1.0) puppetdb-ruby (1.2.0) httparty racc (1.7.1) - rack (2.2.7) + rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.6) - actioncable (= 7.0.6) - actionmailbox (= 7.0.6) - actionmailer (= 7.0.6) - actionpack (= 7.0.6) - actiontext (= 7.0.6) - actionview (= 7.0.6) - activejob (= 7.0.6) - activemodel (= 7.0.6) - activerecord (= 7.0.6) - activestorage (= 7.0.6) - activesupport (= 7.0.6) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 7.0.6) - rails-dom-testing (2.1.1) + railties (= 7.0.8) + rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.6) - actionpack (= 7.0.6) - activesupport (= 7.0.6) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) @@ -322,33 +327,35 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rchardet (1.8.0) - redis (5.0.6) + redis (5.0.7) redis-client (>= 0.9.0) - redis-client (0.14.1) + redis-client (0.17.0) connection_pool regexp_parser (2.8.1) - rexml (3.2.5) + rexml (3.2.6) rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-openapi (0.8.0) + rspec-openapi (0.8.1) actionpack (>= 5.2.0) rspec-core - rspec-support (3.12.0) - rubocop (1.49.0) + rspec-support (3.12.1) + rubocop (1.56.3) + base64 (~> 0.1.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.28.0) + rubocop-ast (1.29.0) parser (>= 3.2.1.0) - rubocop-capybara (2.17.1) + rubocop-capybara (2.19.0) rubocop (~> 1.41) - rubocop-rails (2.18.0) + rubocop-rails (2.21.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -360,12 +367,14 @@ GEM rexml ruby2_keywords (0.0.5) rubyzip (2.3.2) - sass-embedded (1.63.6) + sass-embedded (1.67.0) google-protobuf (~> 3.23) rake (>= 13.0.0) - sass-embedded (1.63.6-x86_64-darwin) + sass-embedded (1.67.0-arm64-darwin) + google-protobuf (~> 3.23) + sass-embedded (1.67.0-x86_64-darwin) google-protobuf (~> 3.23) - sass-embedded (1.63.6-x86_64-linux-gnu) + sass-embedded (1.67.0-x86_64-linux-gnu) google-protobuf (~> 3.23) sassc (2.4.0) ffi (~> 1.9) @@ -383,28 +392,31 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - semantic_puppet (1.0.4) + semantic_puppet (1.1.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.3) + sqlite3 (1.6.6) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.3-x86_64-darwin) - sqlite3 (1.6.3-x86_64-linux) - stimulus-rails (1.2.1) + sqlite3 (1.6.6-arm64-darwin) + sqlite3 (1.6.6-x86_64-darwin) + sqlite3 (1.6.6-x86_64-linux) + stimulus-rails (1.2.2) railties (>= 6.0.0) + sys-filesystem (1.4.4) + ffi (~> 1.1) thor (1.2.2) - tilt (2.2.0) + tilt (2.3.0) timeout (0.4.0) timers (4.3.5) traces (0.11.1) @@ -415,26 +427,26 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) - web-console (4.2.0) + web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webdrivers (5.2.0) + webdrivers (5.3.1) nokogiri (~> 1.6) rubyzip (>= 1.3.0) - selenium-webdriver (~> 4.0) - websocket (1.2.9) - websocket-driver (0.7.5) + selenium-webdriver (~> 4.0, < 4.11) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.8) + zeitwerk (2.6.11) PLATFORMS + arm64-darwin-22 ruby - x86_64-darwin-21 x86_64-darwin-22 x86_64-linux diff --git a/app/models/hiera_data/config.rb b/app/models/hiera_data/config.rb index 4039547d..7fc99572 100644 --- a/app/models/hiera_data/config.rb +++ b/app/models/hiera_data/config.rb @@ -14,7 +14,7 @@ def load_content full_path = @base_path.join(Rails.configuration.hdm.hiera_config_file || "hiera.yaml") defaults = Puppet::Pops::Lookup::HieraConfigV5::DEFAULT_CONFIG_HASH config = if File.exist?(full_path) - parsed_file = YAML.load(File.read(full_path)) + parsed_file = YAML.load_file(full_path) unless parsed_file["version"] == 5 raise Hdm::Error, "hdm needs your hiera.yaml configuration to be in the version 5 format. Please convert your config file(s) before using hdm." end diff --git a/app/models/hiera_data/yaml_file.rb b/app/models/hiera_data/yaml_file.rb index 42652b5a..a1e5cfd4 100644 --- a/app/models/hiera_data/yaml_file.rb +++ b/app/models/hiera_data/yaml_file.rb @@ -25,7 +25,7 @@ def keys def content return nil unless exist? - @content ||= (YAML.load(File.read(path)) || {}) + @content ||= (YAML.load_file(path) || {}) end def [](key) diff --git a/db/migrate/20230419094052_add_role_to_users.rb b/db/migrate/20230419094052_add_role_to_users.rb index 5d99b12c..773d12f0 100644 --- a/db/migrate/20230419094052_add_role_to_users.rb +++ b/db/migrate/20230419094052_add_role_to_users.rb @@ -8,7 +8,7 @@ def up end def down - add_column :users, :admin, :boolean, default: false + add_column :users, :admin, :boolean, default: false # rubocop:disable Rails/ThreeStateBooleanColumn execute "UPDATE users SET admin = '1' WHERE role = 'admin'" change_column :users, :admin, :boolean, default: false, null: false remove_column :users, :role diff --git a/test/models/hiera_data/data_file_test.rb b/test/models/hiera_data/data_file_test.rb index fd8f6419..5d261ced 100644 --- a/test/models/hiera_data/data_file_test.rb +++ b/test/models/hiera_data/data_file_test.rb @@ -20,7 +20,7 @@ class GitIntegration < ActiveSupport::TestCase end test "#write_key triggers git commit" do - git_repo = MiniTest::Mock.new + git_repo = Minitest::Mock.new git_repo.expect(:local_path, DATADIR) git_repo.expect(:commit!, true, [:add, PATH]) HieraData::GitRepo.stub(:new, git_repo) do @@ -28,14 +28,14 @@ class GitIntegration < ActiveSupport::TestCase expected_hash = {"test_key"=>"true"} file = HieraData::DataFile.new(path: PATH) file.write_key('test_key', 'true') - assert_equal expected_hash, YAML.load(File.read(PATH)) + assert_equal expected_hash, YAML.load_file(PATH) end end git_repo.verify end test "#remove_key triggers git commit" do - git_repo = MiniTest::Mock.new + git_repo = Minitest::Mock.new git_repo.expect(:local_path, DATADIR) git_repo.expect(:commit!, true, [:remove, PATH]) HieraData::GitRepo.stub(:new, git_repo) do @@ -44,7 +44,7 @@ class GitIntegration < ActiveSupport::TestCase expected_hash = {} file = HieraData::DataFile.new(path: PATH) file.remove_key('test_key') - assert_equal expected_hash, YAML.load(File.read(PATH)) + assert_equal expected_hash, YAML.load_file(PATH) end end git_repo.verify diff --git a/test/models/hiera_data/yaml_file_test.rb b/test/models/hiera_data/yaml_file_test.rb index 589eb612..1edfbc47 100644 --- a/test/models/hiera_data/yaml_file_test.rb +++ b/test/models/hiera_data/yaml_file_test.rb @@ -78,7 +78,7 @@ class HieraData::YamlFileTest < ActiveSupport::TestCase expected_hash = {"test_key"=>"true"} file = HieraData::YamlFile.new(path:) file.write_key('test_key', 'true') - assert_equal expected_hash, YAML.load(File.read(path)) + assert_equal expected_hash, YAML.load_file(path) end end @@ -89,7 +89,7 @@ class HieraData::YamlFileTest < ActiveSupport::TestCase expected_hash = {} file = HieraData::YamlFile.new(path:) file.remove_key('test_key') - assert_equal expected_hash, YAML.load(File.read(path)) + assert_equal expected_hash, YAML.load_file(path) end end diff --git a/test/models/hiera_data_test.rb b/test/models/hiera_data_test.rb index ab286cf4..2ea4f9e1 100644 --- a/test/models/hiera_data_test.rb +++ b/test/models/hiera_data_test.rb @@ -43,7 +43,7 @@ class HieraDataTest < ActiveSupport::TestCase expected_hash = {"test_key"=>"true"} hiera = HieraData.new('development') hiera.write_key("Eyaml hierarchy", 'nodes/writehost.yaml', 'test_key', 'true') - assert_equal expected_hash, YAML.load(File.read(path)) + assert_equal expected_hash, YAML.load_file(path) end end @@ -55,7 +55,7 @@ class HieraDataTest < ActiveSupport::TestCase hiera = HieraData.new('development') hiera.write_key("Eyaml hierarchy", 'nodes/writehost.yaml', 'test_key', 'true') hiera.write_key("Eyaml hierarchy", 'nodes/writehost.yaml', 'abc', 'def') - assert_equal expected_hash, YAML.load(File.read(path)) + assert_equal expected_hash, YAML.load_file(path) end end @@ -66,7 +66,7 @@ class HieraDataTest < ActiveSupport::TestCase expected_hash = {} hiera = HieraData.new('development') hiera.remove_key("Eyaml hierarchy", 'nodes/writehost.yaml', 'test_key') - assert_equal expected_hash, YAML.load(File.read(path)) + assert_equal expected_hash, YAML.load_file(path) end end diff --git a/test/models/key_test.rb b/test/models/key_test.rb index 7b51a734..b16e52c0 100644 --- a/test/models/key_test.rb +++ b/test/models/key_test.rb @@ -7,7 +7,7 @@ class KeyTest < ActiveSupport::TestCase end test ":all_for puts `lookup_options` first if present" do - hiera_data = MiniTest::Mock.new + hiera_data = Minitest::Mock.new hiera_data.expect(:all_keys, %w(one lookup_options two), [Hash]) HieraData.stub(:new, hiera_data) do keys = Key.all_for(@node) @@ -51,7 +51,7 @@ class KeyTest < ActiveSupport::TestCase test "#lookup_options favors literal match over regexp" do key = Key.new(name: "hdm::integer", environment: @environment) - hiera_data = MiniTest::Mock.new + hiera_data = Minitest::Mock.new lookup_options = { "hdm.*" => {"merge" => "unique"}, "hdm::integer" => {"merge" => "deep"}, @@ -66,7 +66,7 @@ class KeyTest < ActiveSupport::TestCase test "#lookup_options uses first regexp match if no literal match possible" do key = Key.new(name: "hdm::integer", environment: @environment) - hiera_data = MiniTest::Mock.new + hiera_data = Minitest::Mock.new lookup_options = { "hdm.*" => {"merge" => "unique"}, "otherkey" => {"merge" => "deep"}, @@ -81,7 +81,7 @@ class KeyTest < ActiveSupport::TestCase test "#lookup_options defaults to `first`" do key = Key.new(name: "hdm::integer", environment: @environment) - hiera_data = MiniTest::Mock.new + hiera_data = Minitest::Mock.new hiera_data.expect(:lookup_options, {}, [Hash]) key.stub(:hiera_data, hiera_data) do assert_equal "first", key.lookup_options(@node) diff --git a/test/models/value_test.rb b/test/models/value_test.rb index ca26c82a..8c86d07d 100644 --- a/test/models/value_test.rb +++ b/test/models/value_test.rb @@ -10,7 +10,7 @@ class ValueTest < ActiveSupport::TestCase end test "#update uses underlying hiera_data object" do - hiera_data = MiniTest::Mock.new + hiera_data = Minitest::Mock.new hiera_data.expect(:write_key, true, ["Eyaml hierarchy", "common.yaml", "test::dummy", 23], facts: {}) @value.stub(:hiera_data, hiera_data) do @value.update("23") @@ -19,7 +19,7 @@ class ValueTest < ActiveSupport::TestCase end test "#destroy uses underlying hiera_data object" do - hiera_data = MiniTest::Mock.new + hiera_data = Minitest::Mock.new hiera_data.expect(:remove_key, true, ["Eyaml hierarchy", "common.yaml", "test::dummy"], facts: {}) @value.stub(:hiera_data, hiera_data) do @value.destroy