summaryrefslogtreecommitdiff
path: root/spec/integration
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-09-08 23:57:36 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-09 15:01:13 -0700
commitbd6f49e04f56729853f54f2d2d94356edc2c6e8c (patch)
treeb5dafed28e255c193c3b2996ccd7f52b88054801 /spec/integration
parentb6c2173bf578a8f1b44aeea2bc5eef9288e48964 (diff)
downloadchef-bd6f49e04f56729853f54f2d2d94356edc2c6e8c.tar.gz
Use __dir__ instead of getting the dir of __FILE__
This is a bit easier to read Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/integration')
-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
6 files changed, 7 insertions, 7 deletions
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 = []