summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/data/shef-config.rb2
-rwxr-xr-xspec/functional/resource/aix_service_spec.rb4
-rwxr-xr-xspec/functional/resource/aixinit_service_spec.rb2
-rw-r--r--spec/functional/resource/insserv_spec.rb2
-rw-r--r--spec/functional/version_spec.rb2
-rw-r--r--spec/integration/client/client_spec.rb2
-rw-r--r--spec/integration/client/exit_code_spec.rb2
-rw-r--r--spec/integration/client/ipv6_spec.rb2
-rw-r--r--spec/integration/knife/cookbook_api_ipv6_spec.rb2
-rw-r--r--spec/integration/recipes/remote_directory.rb2
-rw-r--r--spec/integration/solo/solo_spec.rb4
-rw-r--r--spec/stress/win32/file_spec.rb2
-rw-r--r--spec/support/chef_helpers.rb4
-rw-r--r--spec/support/matchers/leak.rb4
-rw-r--r--spec/support/shared/functional/win32_service.rb2
-rw-r--r--spec/support/shared/unit/application_dot_d.rb6
-rw-r--r--spec/unit/chef_fs/path_util_spec.rb2
-rw-r--r--spec/unit/cookbook_spec.rb4
-rw-r--r--spec/unit/dsl/declare_resource_spec.rb2
-rw-r--r--spec/unit/file_access_control_spec.rb2
-rw-r--r--spec/unit/knife/bootstrap_spec.rb12
-rw-r--r--spec/unit/lwrp_spec.rb6
-rw-r--r--spec/unit/mixin/securable_spec.rb4
-rw-r--r--spec/unit/recipe_spec.rb2
24 files changed, 39 insertions, 39 deletions
diff --git a/spec/data/shef-config.rb b/spec/data/shef-config.rb
index 0e2521c5b4..1ace5efd21 100644
--- a/spec/data/shef-config.rb
+++ b/spec/data/shef-config.rb
@@ -7,5 +7,5 @@ ohai[:disabled_plugins] << "solaris2::cpu" << "solaris2::dmi" << "solaris2::file
ohai[:disabled_plugins] << "solaris2::virtualization" << "solaris2::zpools"
ohai[:disabled_plugins] << "c" << "php" << "mono" << "groovy" << "lua" << "erlang"
ohai[:disabled_plugins] << "kernel" << "linux::filesystem" << "ruby"
-chef_repo_path File.dirname(__FILE__)
+chef_repo_path __dir__
cookbook_path "#{chef_repo_path}/cookbooks"
diff --git a/spec/functional/resource/aix_service_spec.rb b/spec/functional/resource/aix_service_spec.rb
index ae29d54f2a..16d830b88a 100755
--- a/spec/functional/resource/aix_service_spec.rb
+++ b/spec/functional/resource/aix_service_spec.rb
@@ -89,7 +89,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
describe "When service is a subsystem" do
before(:all) do
- script_dir = File.join(File.dirname(__FILE__), "/../assets/")
+ script_dir = File.join(__dir__, "/../assets/")
shell_out!("mkssys -s ctestsys -p #{script_dir}/testchefsubsys -u #{get_user_id} -S -n 15 -f 9 -R -Q")
end
@@ -117,7 +117,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
# Cannot run this test on a WPAR
describe "When service is a group", :not_wpar do
before(:all) do
- script_dir = File.join(File.dirname(__FILE__), "/../assets/")
+ script_dir = File.join(__dir__, "/../assets/")
shell_out!("mkssys -s ctestsys -p #{script_dir}/testchefsubsys -u #{get_user_id} -S -n 15 -f 9 -R -Q -G ctestgrp")
end
diff --git a/spec/functional/resource/aixinit_service_spec.rb b/spec/functional/resource/aixinit_service_spec.rb
index ecbe0c23fa..c568d40a8d 100755
--- a/spec/functional/resource/aixinit_service_spec.rb
+++ b/spec/functional/resource/aixinit_service_spec.rb
@@ -69,7 +69,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
before(:all) do
File.delete("/etc/rc.d/init.d/chefinittest") if File.exist?("/etc/rc.d/init.d/chefinittest")
- FileUtils.cp((File.join(File.dirname(__FILE__), "/../assets/chefinittest")).to_s, "/etc/rc.d/init.d/chefinittest")
+ FileUtils.cp((File.join(__dir__, "/../assets/chefinittest")).to_s, "/etc/rc.d/init.d/chefinittest")
end
after(:all) do
diff --git a/spec/functional/resource/insserv_spec.rb b/spec/functional/resource/insserv_spec.rb
index 92275fffba..e5c74c68ac 100644
--- a/spec/functional/resource/insserv_spec.rb
+++ b/spec/functional/resource/insserv_spec.rb
@@ -74,7 +74,7 @@ describe Chef::Resource::Service, :requires_root, :opensuse do
before(:all) do
File.delete("/etc/init.d/inittest") if File.exist?("/etc/init.d/inittest")
- FileUtils.cp((File.join(File.dirname(__FILE__), "/../assets/inittest")).to_s, "/etc/init.d/inittest")
+ FileUtils.cp((File.join(__dir__, "/../assets/inittest")).to_s, "/etc/init.d/inittest")
FileUtils.chmod(0755, "/etc/init.d/inittest")
end
diff --git a/spec/functional/version_spec.rb b/spec/functional/version_spec.rb
index 935dabb205..294df7542c 100644
--- a/spec/functional/version_spec.rb
+++ b/spec/functional/version_spec.rb
@@ -23,7 +23,7 @@ require "chef/dist"
describe "Chef Versions", :executables do
include Chef::Mixin::ShellOut
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..") }
+ let(:chef_dir) { File.join(__dir__, "..", "..") }
binaries = [ Chef::Dist::CLIENT, "chef-shell", "chef-apply", "knife", Chef::Dist::SOLOEXEC ]
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 0b206623b1..a33f84610d 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -34,7 +34,7 @@ describe "chef-client" do
include IntegrationSupport
include Chef::Mixin::ShellOut
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
# Invoke `chef-client` as `ruby PATH/TO/chef-client`. This ensures the
# following constraints are satisfied:
diff --git a/spec/integration/client/exit_code_spec.rb b/spec/integration/client/exit_code_spec.rb
index a2f7e87b7e..c2f0c2fb45 100644
--- a/spec/integration/client/exit_code_spec.rb
+++ b/spec/integration/client/exit_code_spec.rb
@@ -11,7 +11,7 @@ describe "chef-client" do
include IntegrationSupport
include Chef::Mixin::ShellOut
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
# Invoke `chef-client` as `ruby PATH/TO/chef-client`. This ensures the
# following constraints are satisfied:
diff --git a/spec/integration/client/ipv6_spec.rb b/spec/integration/client/ipv6_spec.rb
index 30fd991c70..816e1c40e6 100644
--- a/spec/integration/client/ipv6_spec.rb
+++ b/spec/integration/client/ipv6_spec.rb
@@ -74,7 +74,7 @@ describe "chef-client" do
basic_config_file
end
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
let(:chef_client_cmd) { %Q{bundle exec chef-client --minimal-ohai -c "#{path_to("config/client.rb")}" -lwarn} }
diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb
index 38aedb59db..b65cdc697b 100644
--- a/spec/integration/knife/cookbook_api_ipv6_spec.rb
+++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb
@@ -62,7 +62,7 @@ describe "Knife cookbook API integration with IPv6", :workstation, :not_supporte
Dir.mktmpdir
end
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
let(:knife) { "ruby '#{chef_dir}/knife'" }
let(:knife_config_flag) { "-c '#{path_to("config/knife.rb")}'" }
diff --git a/spec/integration/recipes/remote_directory.rb b/spec/integration/recipes/remote_directory.rb
index 8332fb1b56..4d0bcd3514 100644
--- a/spec/integration/recipes/remote_directory.rb
+++ b/spec/integration/recipes/remote_directory.rb
@@ -5,7 +5,7 @@ describe Chef::Resource::RemoteDirectory do
include Chef::Mixin::ShellOut
# Until Cheffish::RSpec has cookbook support, we have to run the whole client
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..", "bin") }
# Invoke `chef-client` as `ruby PATH/TO/chef-client`. This ensures the
# following constraints are satisfied:
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb
index 3029a1b529..75a13b57e4 100644
--- a/spec/integration/solo/solo_spec.rb
+++ b/spec/integration/solo/solo_spec.rb
@@ -12,7 +12,7 @@ describe Chef::Dist::SOLOEXEC do
include IntegrationSupport
include Chef::Mixin::ShellOut
- let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..") }
+ let(:chef_dir) { File.join(__dir__, "..", "..", "..") }
let(:cookbook_x_100_metadata_rb) { cb_metadata("x", "1.0.0") }
@@ -183,7 +183,7 @@ describe Chef::Dist::SOLOEXEC do
# run_lock gets stuck we can discover it.
expect do
Timeout.timeout(120) do
- chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..")
+ chef_dir = File.join(__dir__, "..", "..", "..")
threads = []
diff --git a/spec/stress/win32/file_spec.rb b/spec/stress/win32/file_spec.rb
index c911698029..274d574919 100644
--- a/spec/stress/win32/file_spec.rb
+++ b/spec/stress/win32/file_spec.rb
@@ -21,7 +21,7 @@ require "chef/win32/file" if windows?
describe "Chef::ReservedNames::Win32::File", :windows_only do
before(:each) do
- @path = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "data", "old_home_dir", "my-dot-emacs"))
+ @path = File.expand_path(File.join(__dir__, "..", "..", "data", "old_home_dir", "my-dot-emacs"))
end
it "should not leak significant memory", :volatile do
diff --git a/spec/support/chef_helpers.rb b/spec/support/chef_helpers.rb
index 810ebe56d7..6a0ca878cd 100644
--- a/spec/support/chef_helpers.rb
+++ b/spec/support/chef_helpers.rb
@@ -14,8 +14,8 @@
# limitations under the License.
#
-CHEF_SPEC_DATA = File.expand_path(File.dirname(__FILE__) + "/../data/")
-CHEF_SPEC_ASSETS = File.expand_path(File.dirname(__FILE__) + "/../functional/assets/")
+CHEF_SPEC_DATA = File.expand_path(__dir__ + "/../data/")
+CHEF_SPEC_ASSETS = File.expand_path(__dir__ + "/../functional/assets/")
CHEF_SPEC_BACKUP_PATH = File.join(Dir.tmpdir, "test-backup-path")
def sha256_checksum(path)
diff --git a/spec/support/matchers/leak.rb b/spec/support/matchers/leak.rb
index fd75039b4e..bd59a2755c 100644
--- a/spec/support/matchers/leak.rb
+++ b/spec/support/matchers/leak.rb
@@ -61,10 +61,10 @@ module Matchers
def profiler
@profiler ||= begin
if ChefUtils.windows?
- require File.join(File.dirname(__FILE__), "..", "platforms", "prof", "win32")
+ require File.join(__dir__, "..", "platforms", "prof", "win32")
RSpec::Prof::Win32::Profiler.new
else
- require File.join(File.dirname(__FILE__), "..", "prof", "gc")
+ require File.join(__dir__, "..", "prof", "gc")
RSpec::Prof::GC::Profiler.new
end
end
diff --git a/spec/support/shared/functional/win32_service.rb b/spec/support/shared/functional/win32_service.rb
index dfd66f74ad..890c28de2c 100644
--- a/spec/support/shared/functional/win32_service.rb
+++ b/spec/support/shared/functional/win32_service.rb
@@ -42,7 +42,7 @@ shared_context "using Win32::Service" do
service_name: "spec-service",
service_display_name: "Spec Test Service",
service_description: "Service for testing Chef::Application::WindowsServiceManager.",
- service_file_path: File.expand_path(File.join(File.dirname(__FILE__), "../../platforms/win32/spec_service.rb")),
+ service_file_path: File.expand_path(File.join(__dir__, "../../platforms/win32/spec_service.rb")),
delayed_start: true,
}
end
diff --git a/spec/support/shared/unit/application_dot_d.rb b/spec/support/shared/unit/application_dot_d.rb
index a9e6d46ad9..6d722e3734 100644
--- a/spec/support/shared/unit/application_dot_d.rb
+++ b/spec/support/shared/unit/application_dot_d.rb
@@ -33,7 +33,7 @@ shared_examples_for "an application that loads a dot d" do
# make sure that we are correctly globbing.
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../../data/client.d_00")
+ File.join(__dir__, "../../../data/client.d_00")
)
end
@@ -53,7 +53,7 @@ shared_examples_for "an application that loads a dot d" do
context "when client_d_dir is set to a directory without configuration" do
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../data/client.d_01")
+ File.join(__dir__, "../../data/client.d_01")
)
end
@@ -71,7 +71,7 @@ shared_examples_for "an application that loads a dot d" do
# foo.rb as a directory should be ignored
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../data/client.d_02")
+ File.join(__dir__, "../../data/client.d_02")
)
end
diff --git a/spec/unit/chef_fs/path_util_spec.rb b/spec/unit/chef_fs/path_util_spec.rb
index 694dabf5d7..4056c240cc 100644
--- a/spec/unit/chef_fs/path_util_spec.rb
+++ b/spec/unit/chef_fs/path_util_spec.rb
@@ -61,7 +61,7 @@ describe Chef::ChefFS::PathUtils do
end
context "invoking realest_path" do
- let(:good_path) { File.dirname(__FILE__) }
+ let(:good_path) { __dir__ }
let(:parent_path) { File.dirname(good_path) }
it "handles paths with no wildcards or globs" do
diff --git a/spec/unit/cookbook_spec.rb b/spec/unit/cookbook_spec.rb
index 85c31ab42b..04b729c127 100644
--- a/spec/unit/cookbook_spec.rb
+++ b/spec/unit/cookbook_spec.rb
@@ -19,10 +19,10 @@
require "spec_helper"
describe Chef::CookbookVersion do
- COOKBOOK_PATH = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks", "openldap"))
+ COOKBOOK_PATH = File.expand_path(File.join(__dir__, "..", "data", "cookbooks", "openldap"))
before(:each) do
- @cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks"))
+ @cookbook_repo = File.expand_path(File.join(__dir__, "..", "data", "cookbooks"))
cl = Chef::CookbookLoader.new(@cookbook_repo)
cl.load_cookbooks
@cookbook_collection = Chef::CookbookCollection.new(cl)
diff --git a/spec/unit/dsl/declare_resource_spec.rb b/spec/unit/dsl/declare_resource_spec.rb
index 4fcdd4d048..53b0713c42 100644
--- a/spec/unit/dsl/declare_resource_spec.rb
+++ b/spec/unit/dsl/declare_resource_spec.rb
@@ -19,7 +19,7 @@ require "spec_helper"
describe Chef::ResourceCollection do
let(:run_context) do
- cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "data", "cookbooks"))
+ cookbook_repo = File.expand_path(File.join(__dir__, "..", "..", "data", "cookbooks"))
cookbook_loader = Chef::CookbookLoader.new(cookbook_repo)
cookbook_loader.load_cookbooks
node = Chef::Node.new
diff --git a/spec/unit/file_access_control_spec.rb b/spec/unit/file_access_control_spec.rb
index 18983e6ff5..dfa0bcf673 100644
--- a/spec/unit/file_access_control_spec.rb
+++ b/spec/unit/file_access_control_spec.rb
@@ -26,7 +26,7 @@ describe Chef::FileAccessControl do
# we have to re-load the file so the proper
# platform specific module is mixed in
@node = Chef::Node.new
- load File.join(File.dirname(__FILE__), "..", "..", "lib", "chef", "file_access_control.rb")
+ load File.join(__dir__, "..", "..", "lib", "chef", "file_access_control.rb")
@resource = Chef::Resource::File.new("/tmp/a_file.txt")
@resource.owner("toor")
@resource.group("wheel")
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index 130a097da2..15a51b7f92 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -185,7 +185,7 @@ describe Chef::Knife::Bootstrap do
context "when :bootstrap_template config is set to a template name" do
let(:bootstrap_template) { "example" }
- let(:builtin_template_path) { File.expand_path(File.join(File.dirname(__FILE__), "../../../lib/chef/knife/bootstrap/templates", "example.erb")) }
+ let(:builtin_template_path) { File.expand_path(File.join(__dir__, "../../../lib/chef/knife/bootstrap/templates", "example.erb")) }
let(:chef_config_dir_template_path) { "/knife/chef/config/bootstrap/example.erb" }
@@ -472,7 +472,7 @@ describe Chef::Knife::Bootstrap do
end
describe "when transferring trusted certificates" do
- let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(File.dirname(__FILE__), "../../data/trusted_certs")) }
+ let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(__dir__, "../../data/trusted_certs")) }
let(:rendered_template) do
knife.merge_configs
@@ -504,7 +504,7 @@ describe Chef::Knife::Bootstrap do
end
context "when :trusted_cets_dir is empty" do
- let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(File.dirname(__FILE__), "../../data/trusted_certs_empty")) }
+ let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(__dir__, "../../data/trusted_certs_empty")) }
it "doesn't create /etc/chef/trusted_certs if :trusted_certs_dir is empty" do
expect(rendered_template).not_to match(%r{mkdir -p /etc/chef/trusted_certs})
end
@@ -514,7 +514,7 @@ describe Chef::Knife::Bootstrap do
context "when doing fips things" do
let(:template_file) { File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "no_proxy.erb")) }
- let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(File.dirname(__FILE__), "../../data/trusted_certs")) }
+ let(:trusted_certs_dir) { Chef::Util::PathHelper.cleanpath(File.join(__dir__, "../../data/trusted_certs")) }
before do
Chef::Config[:knife][:bootstrap_template] = template_file
@@ -570,7 +570,7 @@ describe Chef::Knife::Bootstrap do
context "when client_d_dir is set" do
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../data/client.d_00")
+ File.join(__dir__, "../../data/client.d_00")
)
end
@@ -597,7 +597,7 @@ describe Chef::Knife::Bootstrap do
context "a nested directory structure" do
let(:client_d_dir) do
Chef::Util::PathHelper.cleanpath(
- File.join(File.dirname(__FILE__), "../../data/client.d_01")
+ File.join(__dir__, "../../data/client.d_01")
)
end
it "creates a file foo/bar.rb" do
diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb
index a933d23afe..ac2c95d7e7 100644
--- a/spec/unit/lwrp_spec.rb
+++ b/spec/unit/lwrp_spec.rb
@@ -169,7 +169,7 @@ describe "LWRP" do
describe "Lightweight Chef::Resource" do
before do
- Dir[File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "lwrp", "resources", "*"))].each do |file|
+ Dir[File.expand_path(File.join(__dir__, "..", "data", "lwrp", "resources", "*"))].each do |file|
Chef::Resource::LWRPBase.build_from_file("lwrp", file, nil)
end
end
@@ -211,7 +211,7 @@ describe "LWRP" do
node.normal[:penguin_name] = "jackass"
run_context = Chef::RunContext.new(node, Chef::CookbookCollection.new, @events)
- Dir[File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "lwrp", "resources_with_default_attributes", "*"))].each do |file|
+ Dir[File.expand_path(File.join(__dir__, "..", "data", "lwrp", "resources_with_default_attributes", "*"))].each do |file|
Chef::Resource::LWRPBase.build_from_file("lwrp", file, run_context)
end
@@ -654,7 +654,7 @@ describe "LWRP" do
end
let(:run_context) do
- cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks"))
+ cookbook_repo = File.expand_path(File.join(__dir__, "..", "data", "cookbooks"))
cookbook_loader = Chef::CookbookLoader.new(cookbook_repo)
cookbook_loader.load_cookbooks
cookbook_collection = Chef::CookbookCollection.new(cookbook_loader)
diff --git a/spec/unit/mixin/securable_spec.rb b/spec/unit/mixin/securable_spec.rb
index 4863693dba..bbbd6bab84 100644
--- a/spec/unit/mixin/securable_spec.rb
+++ b/spec/unit/mixin/securable_spec.rb
@@ -45,7 +45,7 @@ describe Chef::Mixin::Securable do
describe "unix-specific behavior" do
before(:each) do
platform_mock :unix do
- load File.join(File.dirname(__FILE__), "..", "..", "..", "lib", "chef", "mixin", "securable.rb")
+ load File.join(__dir__, "..", "..", "..", "lib", "chef", "mixin", "securable.rb")
@securable = Object.new
@securable.send(:extend, Chef::Mixin::Securable)
@securable.send(:extend, Chef::Mixin::ParamsValidate)
@@ -176,7 +176,7 @@ describe Chef::Mixin::Securable do
describe "windows-specific behavior" do
before(:each) do
platform_mock :windows do
- load File.join(File.dirname(__FILE__), "..", "..", "..", "lib", "chef", "mixin", "securable.rb")
+ load File.join(__dir__, "..", "..", "..", "lib", "chef", "mixin", "securable.rb")
securable_class = Class.new do
include Chef::Mixin::Securable
include Chef::Mixin::ParamsValidate
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 9df46b46e2..ffa7025e3f 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -25,7 +25,7 @@ require "chef/platform/resource_priority_map"
describe Chef::Recipe do
let(:cookbook_collection) do
- cookbook_repo = File.expand_path(File.join(File.dirname(__FILE__), "..", "data", "cookbooks"))
+ cookbook_repo = File.expand_path(File.join(__dir__, "..", "data", "cookbooks"))
cookbook_loader = Chef::CookbookLoader.new(cookbook_repo)
cookbook_loader.load_cookbooks
Chef::CookbookCollection.new(cookbook_loader)