summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2017-01-25 11:38:49 +0000
committerGitHub <noreply@github.com>2017-01-25 11:38:49 +0000
commit1128df06fff4321e2002ec45c6548d0c63f9ae98 (patch)
tree510cbf4ba6008239235bd793af79d30bed230755
parent3e27195210c8ee77114c4b6c39f56be1d91f42a4 (diff)
parent8bcca46f3b117f5085516569c3a0df81f725d752 (diff)
downloadohai-1128df06fff4321e2002ec45c6548d0c63f9ae98.tar.gz
Merge pull request #948 from chef/minor_spec_cleanup
Minor spec file cleanup
-rw-r--r--Gemfile1
-rw-r--r--platform_simulation_specs/common/ohai_plugin_common_spec.rb2
-rw-r--r--platform_simulation_specs/plugins/c_spec.rb5
-rw-r--r--platform_simulation_specs/plugins/erlang_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/go_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/groovy_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/java_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/kernel_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/lua_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/nodejs_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/perl_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/php_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/python_spec.rb4
-rw-r--r--platform_simulation_specs/tools/grab_data.rb2
-rw-r--r--spec/functional/application_spec.rb1
-rw-r--r--spec/functional/plugins/powershell_spec.rb2
-rw-r--r--spec/functional/plugins/root_group_spec.rb2
-rw-r--r--spec/functional/plugins/windows/uptime_spec.rb2
-rw-r--r--spec/ohai_spec.rb2
-rw-r--r--spec/support/integration_helper.rb17
-rw-r--r--spec/support/platform_helpers.rb17
-rw-r--r--spec/unit/application_spec.rb1
-rw-r--r--spec/unit/config_spec.rb1
-rw-r--r--spec/unit/dsl/plugin_spec.rb2
-rw-r--r--spec/unit/hints_spec.rb2
-rw-r--r--spec/unit/loader_spec.rb2
-rw-r--r--spec/unit/mixin/command_spec.rb2
-rw-r--r--spec/unit/mixin/ec2_metadata_spec.rb2
-rw-r--r--spec/unit/mixin/softlayer_metadata_spec.rb2
-rw-r--r--spec/unit/plugin_config_spec.rb1
-rw-r--r--spec/unit/plugins/abort_spec.rb2
-rw-r--r--spec/unit/plugins/aix/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/aix/filesystem_spec.rb3
-rw-r--r--spec/unit/plugins/aix/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/aix/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/aix/memory_spec.rb2
-rw-r--r--spec/unit/plugins/aix/network_spec.rb2
-rw-r--r--spec/unit/plugins/aix/os_spec.rb2
-rw-r--r--spec/unit/plugins/aix/platform_spec.rb2
-rw-r--r--spec/unit/plugins/aix/uptime_spec.rb2
-rw-r--r--spec/unit/plugins/aix/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/azure_spec.rb2
-rw-r--r--spec/unit/plugins/bsd/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/bsd/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/c_spec.rb2
-rw-r--r--spec/unit/plugins/chef_spec.rb3
-rw-r--r--spec/unit/plugins/cloud_spec.rb2
-rw-r--r--spec/unit/plugins/cloud_v2_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/filesystem2_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/hardware_spec.rb4
-rw-r--r--spec/unit/plugins/darwin/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/memory_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/network_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/platform_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/system_profiler_spec.rb4
-rw-r--r--spec/unit/plugins/darwin/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/digital_ocean_spec.rb2
-rw-r--r--spec/unit/plugins/dmi_spec.rb2
-rw-r--r--spec/unit/plugins/ec2_spec.rb2
-rw-r--r--spec/unit/plugins/elixir_spec.rb2
-rw-r--r--spec/unit/plugins/erlang_spec.rb2
-rw-r--r--spec/unit/plugins/eucalyptus_spec.rb2
-rw-r--r--spec/unit/plugins/fail_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/os_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/platform_spec.rb2
-rw-r--r--spec/unit/plugins/gce_spec.rb2
-rw-r--r--spec/unit/plugins/go_spec.rb2
-rw-r--r--spec/unit/plugins/groovy_spec.rb2
-rw-r--r--spec/unit/plugins/haskell_spec.rb2
-rw-r--r--spec/unit/plugins/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/init_package_spec.rb2
-rw-r--r--spec/unit/plugins/ip_scopes_spec.rb24
-rw-r--r--spec/unit/plugins/java_spec.rb2
-rw-r--r--spec/unit/plugins/joyent_spec.rb18
-rw-r--r--spec/unit/plugins/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/linode_spec.rb2
-rw-r--r--spec/unit/plugins/linux/block_device_spec.rb2
-rw-r--r--spec/unit/plugins/linux/cpu_spec.rb3
-rw-r--r--spec/unit/plugins/linux/filesystem2_spec.rb2
-rw-r--r--spec/unit/plugins/linux/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/linux/fips_spec.rb2
-rw-r--r--spec/unit/plugins/linux/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/linux/hostnamectl_spec.rb2
-rw-r--r--spec/unit/plugins/linux/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/linux/lsb_spec.rb2
-rw-r--r--spec/unit/plugins/linux/machineid_spec.rb2
-rw-r--r--spec/unit/plugins/linux/mdadm_spec.rb2
-rw-r--r--spec/unit/plugins/linux/memory_spec.rb2
-rw-r--r--spec/unit/plugins/linux/network_spec.rb10
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb2
-rw-r--r--spec/unit/plugins/linux/sessions_spec.rb2
-rw-r--r--spec/unit/plugins/linux/uptime_spec.rb2
-rw-r--r--spec/unit/plugins/linux/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/lua_spec.rb2
-rw-r--r--spec/unit/plugins/mono_spec.rb2
-rw-r--r--spec/unit/plugins/netbsd/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/netbsd/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/netbsd/platform_spec.rb2
-rw-r--r--spec/unit/plugins/network_spec.rb2
-rw-r--r--spec/unit/plugins/nodejs_spec.rb2
-rw-r--r--spec/unit/plugins/ohai_spec.rb2
-rw-r--r--spec/unit/plugins/ohai_time_spec.rb2
-rw-r--r--spec/unit/plugins/openbsd/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/openbsd/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/openbsd/platform_spec.rb2
-rw-r--r--spec/unit/plugins/openstack_spec.rb5
-rw-r--r--spec/unit/plugins/os_spec.rb2
-rw-r--r--spec/unit/plugins/packages_spec.rb2
-rw-r--r--spec/unit/plugins/passwd_spec.rb18
-rw-r--r--spec/unit/plugins/perl_spec.rb2
-rw-r--r--spec/unit/plugins/php_spec.rb2
-rw-r--r--spec/unit/plugins/platform_spec.rb2
-rw-r--r--spec/unit/plugins/powershell_spec.rb2
-rw-r--r--spec/unit/plugins/python_spec.rb2
-rw-r--r--spec/unit/plugins/rackspace_spec.rb3
-rw-r--r--spec/unit/plugins/root_group_spec.rb4
-rw-r--r--spec/unit/plugins/ruby_spec.rb2
-rw-r--r--spec/unit/plugins/rust_spec.rb2
-rw-r--r--spec/unit/plugins/scala_spec.rb2
-rw-r--r--spec/unit/plugins/shard_spec.rb2
-rw-r--r--spec/unit/plugins/shells_spec.rb2
-rw-r--r--spec/unit/plugins/softlayer_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/dmi_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/memory_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/network_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/platform_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/zpools_spec.rb2
-rw-r--r--spec/unit/plugins/ssh_host_keys_spec.rb2
-rw-r--r--spec/unit/plugins/sysconf_spec.rb2
-rw-r--r--spec/unit/plugins/timezone_spec.rb2
-rw-r--r--spec/unit/plugins/virtualbox_spec.rb2
-rw-r--r--spec/unit/plugins/vmware_spec.rb3
-rw-r--r--spec/unit/plugins/windows/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/windows/fips_spec.rb2
-rw-r--r--spec/unit/plugins/windows/memory_spec.rb2
-rw-r--r--spec/unit/plugins/windows/uptime_spec.rb2
-rw-r--r--spec/unit/plugins/windows/virtualization_spec.rb2
-rw-r--r--spec/unit/provides_map_spec.rb2
-rw-r--r--spec/unit/runner_spec.rb2
-rw-r--r--spec/unit/system_spec.rb2
-rw-r--r--spec/unit/util/file_helper_spec.rb2
-rw-r--r--spec/unit/util/ip_helper_spec.rb2
152 files changed, 247 insertions, 181 deletions
diff --git a/Gemfile b/Gemfile
index b3f7fdb8..88e22611 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,4 +15,5 @@ group :development do
gem "rspec-collection_matchers", "~> 1.0"
gem "rspec_junit_formatter"
gem "github_changelog_generator", git: "https://github.com/tduffield/github-changelog-generator", branch: "adjust-tag-section-mapping"
+ gem "ipaddr_extensions"
end
diff --git a/platform_simulation_specs/common/ohai_plugin_common_spec.rb b/platform_simulation_specs/common/ohai_plugin_common_spec.rb
index fd83d986..bb407bd4 100644
--- a/platform_simulation_specs/common/ohai_plugin_common_spec.rb
+++ b/platform_simulation_specs/common/ohai_plugin_common_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/ohai_plugin_common.rb")
+require_relative "ohai_plugin_common.rb"
describe OhaiPluginCommon, "subsumes?" do
before(:each) do
diff --git a/platform_simulation_specs/plugins/c_spec.rb b/platform_simulation_specs/plugins/c_spec.rb
index 3cd58e81..a40db825 100644
--- a/platform_simulation_specs/plugins/c_spec.rb
+++ b/platform_simulation_specs/plugins/c_spec.rb
@@ -17,9 +17,8 @@
#
require "rbconfig"
-
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin c" do
test_plugin(%w{languages c}, [ "/lib/libc.so.6", "/lib64/libc.so.6", "gcc", "cl", "devenv.com", "xlc", "cc", "what" ]) do |p|
diff --git a/platform_simulation_specs/plugins/erlang_spec.rb b/platform_simulation_specs/plugins/erlang_spec.rb
index 2fc22ec5..dab10321 100644
--- a/platform_simulation_specs/plugins/erlang_spec.rb
+++ b/platform_simulation_specs/plugins/erlang_spec.rb
@@ -17,8 +17,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin erlang" do
test_plugin(%w{languages erlang}, [ "erl" ]) do |p|
diff --git a/platform_simulation_specs/plugins/go_spec.rb b/platform_simulation_specs/plugins/go_spec.rb
index f76f8372..d70372f9 100644
--- a/platform_simulation_specs/plugins/go_spec.rb
+++ b/platform_simulation_specs/plugins/go_spec.rb
@@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin go" do
test_plugin(%w{languages go}, [ "go" ]) do |p|
diff --git a/platform_simulation_specs/plugins/groovy_spec.rb b/platform_simulation_specs/plugins/groovy_spec.rb
index cebbdda4..ee5ac9a8 100644
--- a/platform_simulation_specs/plugins/groovy_spec.rb
+++ b/platform_simulation_specs/plugins/groovy_spec.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin groovy" do
test_plugin(%w{languages groovy}, [ "groovy" ]) do |p|
diff --git a/platform_simulation_specs/plugins/java_spec.rb b/platform_simulation_specs/plugins/java_spec.rb
index 71e1df11..1d86f24d 100644
--- a/platform_simulation_specs/plugins/java_spec.rb
+++ b/platform_simulation_specs/plugins/java_spec.rb
@@ -17,8 +17,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin java (Java5 Client VM)" do
test_plugin(%w{languages java}, [ "java" ]) do |p|
diff --git a/platform_simulation_specs/plugins/kernel_spec.rb b/platform_simulation_specs/plugins/kernel_spec.rb
index 85a6e4bd..e1bc2aff 100644
--- a/platform_simulation_specs/plugins/kernel_spec.rb
+++ b/platform_simulation_specs/plugins/kernel_spec.rb
@@ -17,8 +17,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "../../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "Linux kernel plugin" do
test_plugin([ "kernel" ], %w{uname env}) do |p|
diff --git a/platform_simulation_specs/plugins/lua_spec.rb b/platform_simulation_specs/plugins/lua_spec.rb
index 59f4d038..cf5e573d 100644
--- a/platform_simulation_specs/plugins/lua_spec.rb
+++ b/platform_simulation_specs/plugins/lua_spec.rb
@@ -18,8 +18,8 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin lua" do
test_plugin(%w{languages lua}, [ "lua" ]) do |p|
diff --git a/platform_simulation_specs/plugins/nodejs_spec.rb b/platform_simulation_specs/plugins/nodejs_spec.rb
index fda9d5ff..3de60fa7 100644
--- a/platform_simulation_specs/plugins/nodejs_spec.rb
+++ b/platform_simulation_specs/plugins/nodejs_spec.rb
@@ -18,8 +18,8 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin nodejs" do
test_plugin(%w{languages nodejs}, [ "node" ]) do |p|
diff --git a/platform_simulation_specs/plugins/perl_spec.rb b/platform_simulation_specs/plugins/perl_spec.rb
index aa851796..bf4a9330 100644
--- a/platform_simulation_specs/plugins/perl_spec.rb
+++ b/platform_simulation_specs/plugins/perl_spec.rb
@@ -17,8 +17,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin perl" do
test_plugin(%w{languages perl}, [ "perl" ]) do |p|
diff --git a/platform_simulation_specs/plugins/php_spec.rb b/platform_simulation_specs/plugins/php_spec.rb
index 6e3ecb59..6fe00caf 100644
--- a/platform_simulation_specs/plugins/php_spec.rb
+++ b/platform_simulation_specs/plugins/php_spec.rb
@@ -18,8 +18,8 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin php" do
test_plugin(%w{languages php}, [ "php" ]) do |p|
diff --git a/platform_simulation_specs/plugins/python_spec.rb b/platform_simulation_specs/plugins/python_spec.rb
index d34ce105..93cf5728 100644
--- a/platform_simulation_specs/plugins/python_spec.rb
+++ b/platform_simulation_specs/plugins/python_spec.rb
@@ -17,8 +17,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require_relative "../../spec_helper.rb"
+require_relative "../common/ohai_plugin_common.rb"
describe Ohai::System, "plugin python" do
test_plugin(%w{languages python}, [ "python" ]) do |p|
diff --git a/platform_simulation_specs/tools/grab_data.rb b/platform_simulation_specs/tools/grab_data.rb
index 662c874d..6c419a5f 100644
--- a/platform_simulation_specs/tools/grab_data.rb
+++ b/platform_simulation_specs/tools/grab_data.rb
@@ -30,7 +30,7 @@ require "set"
require "mixlib/shellout"
require "mixlib/cli"
require "optparse"
-require File.expand_path(File.dirname(__FILE__) + "/../spec/unit/path/ohai_plugin_common.rb")
+require_relative "../spec/unit/path/ohai_plugin_common.rb"
#get options
class MyCLI
diff --git a/spec/functional/application_spec.rb b/spec/functional/application_spec.rb
index c6e0c98c..4fc25097 100644
--- a/spec/functional/application_spec.rb
+++ b/spec/functional/application_spec.rb
@@ -17,7 +17,6 @@
#
require_relative "../spec_helper"
-
require "ohai/application"
RSpec.describe "Ohai::Application" do
diff --git a/spec/functional/plugins/powershell_spec.rb b/spec/functional/plugins/powershell_spec.rb
index 865bb850..38fab45d 100644
--- a/spec/functional/plugins/powershell_spec.rb
+++ b/spec/functional/plugins/powershell_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "languages plugin" do
VERSION_MATCHING_REGEX = /^(?:[\d]+\.)+[\d]+$/
diff --git a/spec/functional/plugins/root_group_spec.rb b/spec/functional/plugins/root_group_spec.rb
index 781582d8..153f0c09 100644
--- a/spec/functional/plugins/root_group_spec.rb
+++ b/spec/functional/plugins/root_group_spec.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "root_group plugin" do
let(:plugin) { get_plugin("root_group") }
diff --git a/spec/functional/plugins/windows/uptime_spec.rb b/spec/functional/plugins/windows/uptime_spec.rb
index d1abd681..b4effc68 100644
--- a/spec/functional/plugins/windows/uptime_spec.rb
+++ b/spec/functional/plugins/windows/uptime_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Windows plugin uptime" do
diff --git a/spec/ohai_spec.rb b/spec/ohai_spec.rb
index 376356b0..f3de6b63 100644
--- a/spec/ohai_spec.rb
+++ b/spec/ohai_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/spec_helper.rb")
+require_relative "spec_helper.rb"
describe Ohai do
diff --git a/spec/support/integration_helper.rb b/spec/support/integration_helper.rb
index 38554e40..05c5de0c 100644
--- a/spec/support/integration_helper.rb
+++ b/spec/support/integration_helper.rb
@@ -1,3 +1,20 @@
+#
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you
+# may not use this file except in compliance with the License. You may
+# obtain a copy of the license at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License
+#
+
require "tmpdir"
module IntegrationSupport
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 4f1eb1c8..2a531883 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -1,3 +1,20 @@
+#
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you
+# may not use this file except in compliance with the License. You may
+# obtain a copy of the license at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License
+#
+
def windows?
!!(RUBY_PLATFORM =~ /mswin|mingw|windows/)
end
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index e815063f..687031b7 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -17,7 +17,6 @@
#
require_relative "../spec_helper"
-
require "ohai/application"
RSpec.describe "Ohai::Application" do
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index ab67a932..525a79d7 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -17,7 +17,6 @@
#
require_relative "../spec_helper"
-
require "ohai/config"
RSpec.describe Ohai::Config do
diff --git a/spec/unit/dsl/plugin_spec.rb b/spec/unit/dsl/plugin_spec.rb
index a5f99920..c1ed623c 100644
--- a/spec/unit/dsl/plugin_spec.rb
+++ b/spec/unit/dsl/plugin_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License
#
-require File.expand_path("../../../spec_helper.rb", __FILE__)
+require_relative "../../spec_helper.rb"
shared_examples "Ohai::DSL::Plugin" do
context "#initialize" do
diff --git a/spec/unit/hints_spec.rb b/spec/unit/hints_spec.rb
index 88556528..80477d53 100644
--- a/spec/unit/hints_spec.rb
+++ b/spec/unit/hints_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper.rb"
describe "Ohai::Hints" do
# We are using the plugins directory infrastructure to test hints
diff --git a/spec/unit/loader_spec.rb b/spec/unit/loader_spec.rb
index bfe2aa83..300407dc 100644
--- a/spec/unit/loader_spec.rb
+++ b/spec/unit/loader_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper.rb"
describe Ohai::Loader do
extend IntegrationSupport
diff --git a/spec/unit/mixin/command_spec.rb b/spec/unit/mixin/command_spec.rb
index e9afa2cd..7b2385d0 100644
--- a/spec/unit/mixin/command_spec.rb
+++ b/spec/unit/mixin/command_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::Mixin::Command, "shell_out" do
let(:cmd) { "sparkle-dream --version" }
diff --git a/spec/unit/mixin/ec2_metadata_spec.rb b/spec/unit/mixin/ec2_metadata_spec.rb
index 2bd867d0..affd7afe 100644
--- a/spec/unit/mixin/ec2_metadata_spec.rb
+++ b/spec/unit/mixin/ec2_metadata_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
require "ohai/mixin/ec2_metadata"
describe Ohai::Mixin::Ec2Metadata do
diff --git a/spec/unit/mixin/softlayer_metadata_spec.rb b/spec/unit/mixin/softlayer_metadata_spec.rb
index a4719685..6fe2ddee 100644
--- a/spec/unit/mixin/softlayer_metadata_spec.rb
+++ b/spec/unit/mixin/softlayer_metadata_spec.rb
@@ -17,7 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
require "ohai/mixin/softlayer_metadata"
describe ::Ohai::Mixin::SoftlayerMetadata do
diff --git a/spec/unit/plugin_config_spec.rb b/spec/unit/plugin_config_spec.rb
index 5cf9f6d9..263121a5 100644
--- a/spec/unit/plugin_config_spec.rb
+++ b/spec/unit/plugin_config_spec.rb
@@ -16,7 +16,6 @@
#
require_relative "../spec_helper"
-
require "ohai/plugin_config"
describe "Ohai::PluginConfig" do
diff --git a/spec/unit/plugins/abort_spec.rb b/spec/unit/plugins/abort_spec.rb
index 6140419e..3a37e933 100644
--- a/spec/unit/plugins/abort_spec.rb
+++ b/spec/unit/plugins/abort_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
tmp = ENV["TMPDIR"] || ENV["TMP"] || ENV["TEMP"] || "/tmp"
diff --git a/spec/unit/plugins/aix/cpu_spec.rb b/spec/unit/plugins/aix/cpu_spec.rb
index 5cafedc8..7541bebb 100644
--- a/spec/unit/plugins/aix/cpu_spec.rb
+++ b/spec/unit/plugins/aix/cpu_spec.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "AIX cpu plugin" do
before(:each) do
diff --git a/spec/unit/plugins/aix/filesystem_spec.rb b/spec/unit/plugins/aix/filesystem_spec.rb
index 33d63af7..3ca3dcf8 100644
--- a/spec/unit/plugins/aix/filesystem_spec.rb
+++ b/spec/unit/plugins/aix/filesystem_spec.rb
@@ -15,7 +15,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "AIX filesystem plugin" do
before(:each) do
diff --git a/spec/unit/plugins/aix/hostname_spec.rb b/spec/unit/plugins/aix/hostname_spec.rb
index b378dd0a..6f419d58 100644
--- a/spec/unit/plugins/aix/hostname_spec.rb
+++ b/spec/unit/plugins/aix/hostname_spec.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "AIX hostname plugin" do
before(:each) do
diff --git a/spec/unit/plugins/aix/kernel_spec.rb b/spec/unit/plugins/aix/kernel_spec.rb
index a63023d6..d0c0cded 100644
--- a/spec/unit/plugins/aix/kernel_spec.rb
+++ b/spec/unit/plugins/aix/kernel_spec.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "AIX kernel plugin" do
before(:each) do
diff --git a/spec/unit/plugins/aix/memory_spec.rb b/spec/unit/plugins/aix/memory_spec.rb
index cfe9862f..92736445 100644
--- a/spec/unit/plugins/aix/memory_spec.rb
+++ b/spec/unit/plugins/aix/memory_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "AIX memory plugin" do
before(:each) do
diff --git a/spec/unit/plugins/aix/network_spec.rb b/spec/unit/plugins/aix/network_spec.rb
index 1007a868..5890c6d1 100644
--- a/spec/unit/plugins/aix/network_spec.rb
+++ b/spec/unit/plugins/aix/network_spec.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "AIX network plugin" do
diff --git a/spec/unit/plugins/aix/os_spec.rb b/spec/unit/plugins/aix/os_spec.rb
index 6cc2227d..0a5a8acf 100644
--- a/spec/unit/plugins/aix/os_spec.rb
+++ b/spec/unit/plugins/aix/os_spec.rb
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "AIX os plugin" do
before(:each) do
diff --git a/spec/unit/plugins/aix/platform_spec.rb b/spec/unit/plugins/aix/platform_spec.rb
index 318bc427..10633443 100644
--- a/spec/unit/plugins/aix/platform_spec.rb
+++ b/spec/unit/plugins/aix/platform_spec.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Aix plugin platform" do
before(:each) do
diff --git a/spec/unit/plugins/aix/uptime_spec.rb b/spec/unit/plugins/aix/uptime_spec.rb
index 071e561b..d04403f8 100644
--- a/spec/unit/plugins/aix/uptime_spec.rb
+++ b/spec/unit/plugins/aix/uptime_spec.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Aix plugin uptime" do
diff --git a/spec/unit/plugins/aix/virtualization_spec.rb b/spec/unit/plugins/aix/virtualization_spec.rb
index 4d07f814..37c9c595 100644
--- a/spec/unit/plugins/aix/virtualization_spec.rb
+++ b/spec/unit/plugins/aix/virtualization_spec.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "spec_helper"
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "AIX virtualization plugin" do
diff --git a/spec/unit/plugins/azure_spec.rb b/spec/unit/plugins/azure_spec.rb
index 63238114..82277406 100644
--- a/spec/unit/plugins/azure_spec.rb
+++ b/spec/unit/plugins/azure_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
require "open-uri"
describe Ohai::System, "plugin azure" do
diff --git a/spec/unit/plugins/bsd/filesystem_spec.rb b/spec/unit/plugins/bsd/filesystem_spec.rb
index d337cf79..7b913734 100644
--- a/spec/unit/plugins/bsd/filesystem_spec.rb
+++ b/spec/unit/plugins/bsd/filesystem_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "BSD filesystem plugin" do
let(:plugin) { get_plugin("bsd/filesystem") }
diff --git a/spec/unit/plugins/bsd/virtualization_spec.rb b/spec/unit/plugins/bsd/virtualization_spec.rb
index 1f2c273f..b51996b7 100644
--- a/spec/unit/plugins/bsd/virtualization_spec.rb
+++ b/spec/unit/plugins/bsd/virtualization_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "BSD virtualization plugin" do
before(:each) do
diff --git a/spec/unit/plugins/c_spec.rb b/spec/unit/plugins/c_spec.rb
index ca963f3c..0f4286c7 100644
--- a/spec/unit/plugins/c_spec.rb
+++ b/spec/unit/plugins/c_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
C_GCC = <<EOF
Using built-in specs.
diff --git a/spec/unit/plugins/chef_spec.rb b/spec/unit/plugins/chef_spec.rb
index 952edbad..672a172c 100644
--- a/spec/unit/plugins/chef_spec.rb
+++ b/spec/unit/plugins/chef_spec.rb
@@ -19,8 +19,7 @@
#
begin
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-
+ require_relative "../../spec_helper.rb"
require "chef/version"
describe Ohai::System, "plugin chef" do
diff --git a/spec/unit/plugins/cloud_spec.rb b/spec/unit/plugins/cloud_spec.rb
index 9fa2ba7d..bd2e9d02 100644
--- a/spec/unit/plugins/cloud_spec.rb
+++ b/spec/unit/plugins/cloud_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin cloud" do
before(:each) do
diff --git a/spec/unit/plugins/cloud_v2_spec.rb b/spec/unit/plugins/cloud_v2_spec.rb
index e08e519d..fc736f95 100644
--- a/spec/unit/plugins/cloud_v2_spec.rb
+++ b/spec/unit/plugins/cloud_v2_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
require "ipaddr"
describe "CloudAttrs object" do
diff --git a/spec/unit/plugins/darwin/cpu_spec.rb b/spec/unit/plugins/darwin/cpu_spec.rb
index d6930c80..2053fb49 100644
--- a/spec/unit/plugins/darwin/cpu_spec.rb
+++ b/spec/unit/plugins/darwin/cpu_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Darwin cpu plugin" do
before(:each) do
diff --git a/spec/unit/plugins/darwin/filesystem2_spec.rb b/spec/unit/plugins/darwin/filesystem2_spec.rb
index 2a652593..6ba89ac3 100644
--- a/spec/unit/plugins/darwin/filesystem2_spec.rb
+++ b/spec/unit/plugins/darwin/filesystem2_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "darwin filesystem2 plugin" do
let (:plugin) { get_plugin("darwin/filesystem2") }
diff --git a/spec/unit/plugins/darwin/filesystem_spec.rb b/spec/unit/plugins/darwin/filesystem_spec.rb
index b703bce9..d97a89d9 100644
--- a/spec/unit/plugins/darwin/filesystem_spec.rb
+++ b/spec/unit/plugins/darwin/filesystem_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "darwin filesystem plugin" do
let (:plugin) { get_plugin("darwin/filesystem") }
diff --git a/spec/unit/plugins/darwin/hardware_spec.rb b/spec/unit/plugins/darwin/hardware_spec.rb
index de69f3ee..3f0f6b0d 100644
--- a/spec/unit/plugins/darwin/hardware_spec.rb
+++ b/spec/unit/plugins/darwin/hardware_spec.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-require File.expand_path("#{File.dirname(__FILE__)}/hardware_system_profiler_output.rb")
+require_relative "../../../spec_helper.rb"
+require_relative "hardware_system_profiler_output.rb"
describe Ohai::System, "Darwin hardware plugin", :unix_only do
let (:plugin) { get_plugin("darwin/hardware") }
diff --git a/spec/unit/plugins/darwin/hostname_spec.rb b/spec/unit/plugins/darwin/hostname_spec.rb
index b95c8f8a..05184b83 100644
--- a/spec/unit/plugins/darwin/hostname_spec.rb
+++ b/spec/unit/plugins/darwin/hostname_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Darwin hostname plugin" do
before(:each) do
diff --git a/spec/unit/plugins/darwin/kernel_spec.rb b/spec/unit/plugins/darwin/kernel_spec.rb
index 54cdb7b4..901962ba 100644
--- a/spec/unit/plugins/darwin/kernel_spec.rb
+++ b/spec/unit/plugins/darwin/kernel_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Darwin kernel plugin" do
before(:each) do
diff --git a/spec/unit/plugins/darwin/memory_spec.rb b/spec/unit/plugins/darwin/memory_spec.rb
index b089fb87..904a5ea7 100644
--- a/spec/unit/plugins/darwin/memory_spec.rb
+++ b/spec/unit/plugins/darwin/memory_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Darwin Memory Plugin" do
before(:each) do
diff --git a/spec/unit/plugins/darwin/network_spec.rb b/spec/unit/plugins/darwin/network_spec.rb
index 7b549dea..fdfb9b7d 100644
--- a/spec/unit/plugins/darwin/network_spec.rb
+++ b/spec/unit/plugins/darwin/network_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Darwin Network Plugin" do
before(:each) do
diff --git a/spec/unit/plugins/darwin/platform_spec.rb b/spec/unit/plugins/darwin/platform_spec.rb
index 53a8ff21..2820caa0 100644
--- a/spec/unit/plugins/darwin/platform_spec.rb
+++ b/spec/unit/plugins/darwin/platform_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Darwin plugin platform" do
before(:each) do
diff --git a/spec/unit/plugins/darwin/system_profiler_spec.rb b/spec/unit/plugins/darwin/system_profiler_spec.rb
index 98b6c845..bea074d0 100644
--- a/spec/unit/plugins/darwin/system_profiler_spec.rb
+++ b/spec/unit/plugins/darwin/system_profiler_spec.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-require File.expand_path("#{File.dirname(__FILE__)}/system_profiler_output.rb")
+require_relative "../../../spec_helper.rb"
+require_relative "system_profiler_output.rb"
begin
require "plist"
diff --git a/spec/unit/plugins/darwin/virtualization_spec.rb b/spec/unit/plugins/darwin/virtualization_spec.rb
index 0529699a..fbf509ed 100644
--- a/spec/unit/plugins/darwin/virtualization_spec.rb
+++ b/spec/unit/plugins/darwin/virtualization_spec.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Darwin virtualization platform" do
let(:plugin) { get_plugin("darwin/virtualization") }
diff --git a/spec/unit/plugins/digital_ocean_spec.rb b/spec/unit/plugins/digital_ocean_spec.rb
index 45b0109d..a593451a 100644
--- a/spec/unit/plugins/digital_ocean_spec.rb
+++ b/spec/unit/plugins/digital_ocean_spec.rb
@@ -16,7 +16,7 @@
#
require "ipaddress"
-require "spec_helper"
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin digital_ocean" do
let(:plugin) { get_plugin("digital_ocean") }
diff --git a/spec/unit/plugins/dmi_spec.rb b/spec/unit/plugins/dmi_spec.rb
index 08a0bf25..9c855a9c 100644
--- a/spec/unit/plugins/dmi_spec.rb
+++ b/spec/unit/plugins/dmi_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
# NOTE: These data lines must be prefixed with one or two tabs, not spaces.
DMI_OUT = <<-EOS
diff --git a/spec/unit/plugins/ec2_spec.rb b/spec/unit/plugins/ec2_spec.rb
index fc83c8cc..d726ead6 100644
--- a/spec/unit/plugins/ec2_spec.rb
+++ b/spec/unit/plugins/ec2_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
require "open-uri"
require "base64"
diff --git a/spec/unit/plugins/elixir_spec.rb b/spec/unit/plugins/elixir_spec.rb
index c3191985..b038bd56 100644
--- a/spec/unit/plugins/elixir_spec.rb
+++ b/spec/unit/plugins/elixir_spec.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin elixir" do
let(:plugin) { get_plugin("elixir") }
diff --git a/spec/unit/plugins/erlang_spec.rb b/spec/unit/plugins/erlang_spec.rb
index 968ec033..78e16446 100644
--- a/spec/unit/plugins/erlang_spec.rb
+++ b/spec/unit/plugins/erlang_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin erlang" do
let(:plugin) { get_plugin("erlang") }
diff --git a/spec/unit/plugins/eucalyptus_spec.rb b/spec/unit/plugins/eucalyptus_spec.rb
index e834b430..8e113a09 100644
--- a/spec/unit/plugins/eucalyptus_spec.rb
+++ b/spec/unit/plugins/eucalyptus_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
require "open-uri"
describe Ohai::System, "plugin eucalyptus" do
diff --git a/spec/unit/plugins/fail_spec.rb b/spec/unit/plugins/fail_spec.rb
index 763dc266..859011c7 100644
--- a/spec/unit/plugins/fail_spec.rb
+++ b/spec/unit/plugins/fail_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
tmp = ENV["TMPDIR"] || ENV["TMP"] || ENV["TEMP"] || "/tmp"
diff --git a/spec/unit/plugins/freebsd/cpu_spec.rb b/spec/unit/plugins/freebsd/cpu_spec.rb
index 1dbbf3a6..b4e16ed4 100644
--- a/spec/unit/plugins/freebsd/cpu_spec.rb
+++ b/spec/unit/plugins/freebsd/cpu_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "FreeBSD cpu plugin on FreeBSD >=10.2" do
before(:each) do
diff --git a/spec/unit/plugins/freebsd/hostname_spec.rb b/spec/unit/plugins/freebsd/hostname_spec.rb
index a1279b20..2f96c4ed 100644
--- a/spec/unit/plugins/freebsd/hostname_spec.rb
+++ b/spec/unit/plugins/freebsd/hostname_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "FreeBSD hostname plugin" do
before(:each) do
diff --git a/spec/unit/plugins/freebsd/kernel_spec.rb b/spec/unit/plugins/freebsd/kernel_spec.rb
index d9baf8fc..9830676d 100644
--- a/spec/unit/plugins/freebsd/kernel_spec.rb
+++ b/spec/unit/plugins/freebsd/kernel_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "FreeBSD kernel plugin" do
before(:each) do
diff --git a/spec/unit/plugins/freebsd/os_spec.rb b/spec/unit/plugins/freebsd/os_spec.rb
index dfb89996..3fffb75a 100644
--- a/spec/unit/plugins/freebsd/os_spec.rb
+++ b/spec/unit/plugins/freebsd/os_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "FreeBSD plugin os" do
before(:each) do
diff --git a/spec/unit/plugins/freebsd/platform_spec.rb b/spec/unit/plugins/freebsd/platform_spec.rb
index 2ddcc4cd..fddf01b3 100644
--- a/spec/unit/plugins/freebsd/platform_spec.rb
+++ b/spec/unit/plugins/freebsd/platform_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "FreeBSD plugin platform" do
before(:each) do
diff --git a/spec/unit/plugins/gce_spec.rb b/spec/unit/plugins/gce_spec.rb
index a30b232d..d357451c 100644
--- a/spec/unit/plugins/gce_spec.rb
+++ b/spec/unit/plugins/gce_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
require "open-uri"
describe Ohai::System, "plugin gce" do
diff --git a/spec/unit/plugins/go_spec.rb b/spec/unit/plugins/go_spec.rb
index 7bd3cd79..86d018c2 100644
--- a/spec/unit/plugins/go_spec.rb
+++ b/spec/unit/plugins/go_spec.rb
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin go" do
let(:plugin) { get_plugin("go") }
diff --git a/spec/unit/plugins/groovy_spec.rb b/spec/unit/plugins/groovy_spec.rb
index 4b614ab3..3deed839 100644
--- a/spec/unit/plugins/groovy_spec.rb
+++ b/spec/unit/plugins/groovy_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin groovy" do
let(:plugin) { get_plugin("groovy") }
diff --git a/spec/unit/plugins/haskell_spec.rb b/spec/unit/plugins/haskell_spec.rb
index 7dc53b69..a20b125e 100644
--- a/spec/unit/plugins/haskell_spec.rb
+++ b/spec/unit/plugins/haskell_spec.rb
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin haskell" do
diff --git a/spec/unit/plugins/hostname_spec.rb b/spec/unit/plugins/hostname_spec.rb
index ed2d4d0a..87719129 100644
--- a/spec/unit/plugins/hostname_spec.rb
+++ b/spec/unit/plugins/hostname_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "hostname plugin" do
before(:each) do
diff --git a/spec/unit/plugins/init_package_spec.rb b/spec/unit/plugins/init_package_spec.rb
index c34fb654..7966963d 100644
--- a/spec/unit/plugins/init_package_spec.rb
+++ b/spec/unit/plugins/init_package_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "Init package" do
let(:plugin) do
diff --git a/spec/unit/plugins/ip_scopes_spec.rb b/spec/unit/plugins/ip_scopes_spec.rb
index 4dd778c4..9e754650 100644
--- a/spec/unit/plugins/ip_scopes_spec.rb
+++ b/spec/unit/plugins/ip_scopes_spec.rb
@@ -1,9 +1,21 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-
-begin
- require "ipaddr_extensions"
-rescue LoadError
-end
+#
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require_relative "../../spec_helper.rb"
+require "ipaddr_extensions"
describe Ohai::System, "plugin ip_scopes" do
let(:plugin) { get_plugin("ip_scopes") }
diff --git a/spec/unit/plugins/java_spec.rb b/spec/unit/plugins/java_spec.rb
index a8279caf..2335d644 100644
--- a/spec/unit/plugins/java_spec.rb
+++ b/spec/unit/plugins/java_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin java (Java5 Client VM)" do
let(:plugin) { get_plugin("java") }
diff --git a/spec/unit/plugins/joyent_spec.rb b/spec/unit/plugins/joyent_spec.rb
index 851826fc..8ee854e0 100644
--- a/spec/unit/plugins/joyent_spec.rb
+++ b/spec/unit/plugins/joyent_spec.rb
@@ -1,4 +1,20 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+#
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin joyent" do
let(:plugin) { get_plugin("joyent") }
diff --git a/spec/unit/plugins/kernel_spec.rb b/spec/unit/plugins/kernel_spec.rb
index c46952e5..ed78d866 100644
--- a/spec/unit/plugins/kernel_spec.rb
+++ b/spec/unit/plugins/kernel_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin kernel" do
before(:each) do
diff --git a/spec/unit/plugins/linode_spec.rb b/spec/unit/plugins/linode_spec.rb
index 43c43f39..866a6ba2 100644
--- a/spec/unit/plugins/linode_spec.rb
+++ b/spec/unit/plugins/linode_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin linode" do
let(:plugin) { get_plugin("linode") }
diff --git a/spec/unit/plugins/linux/block_device_spec.rb b/spec/unit/plugins/linux/block_device_spec.rb
index edb4b243..bbad8b59 100644
--- a/spec/unit/plugins/linux/block_device_spec.rb
+++ b/spec/unit/plugins/linux/block_device_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux Block Device Plugin" do
DISKS = {
diff --git a/spec/unit/plugins/linux/cpu_spec.rb b/spec/unit/plugins/linux/cpu_spec.rb
index f6252453..e801d42a 100644
--- a/spec/unit/plugins/linux/cpu_spec.rb
+++ b/spec/unit/plugins/linux/cpu_spec.rb
@@ -17,8 +17,7 @@
#
require "tempfile"
-
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
shared_examples "Common cpu info" do |total_cpu, real_cpu|
describe "cpu" do
diff --git a/spec/unit/plugins/linux/filesystem2_spec.rb b/spec/unit/plugins/linux/filesystem2_spec.rb
index e62e9d1a..d822c8e8 100644
--- a/spec/unit/plugins/linux/filesystem2_spec.rb
+++ b/spec/unit/plugins/linux/filesystem2_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux filesystem plugin" do
let (:plugin) { get_plugin("linux/filesystem2") }
diff --git a/spec/unit/plugins/linux/filesystem_spec.rb b/spec/unit/plugins/linux/filesystem_spec.rb
index 7375a8cf..4925de75 100644
--- a/spec/unit/plugins/linux/filesystem_spec.rb
+++ b/spec/unit/plugins/linux/filesystem_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux filesystem plugin" do
let(:plugin) { get_plugin("linux/filesystem") }
diff --git a/spec/unit/plugins/linux/fips_spec.rb b/spec/unit/plugins/linux/fips_spec.rb
index 30d70c17..79dd2530 100644
--- a/spec/unit/plugins/linux/fips_spec.rb
+++ b/spec/unit/plugins/linux/fips_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "plugin fips" do
let(:enabled) { "0" }
diff --git a/spec/unit/plugins/linux/hostname_spec.rb b/spec/unit/plugins/linux/hostname_spec.rb
index a7dba293..b81d77e0 100644
--- a/spec/unit/plugins/linux/hostname_spec.rb
+++ b/spec/unit/plugins/linux/hostname_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux hostname plugin" do
before(:each) do
diff --git a/spec/unit/plugins/linux/hostnamectl_spec.rb b/spec/unit/plugins/linux/hostnamectl_spec.rb
index bfa72790..15bea9ed 100644
--- a/spec/unit/plugins/linux/hostnamectl_spec.rb
+++ b/spec/unit/plugins/linux/hostnamectl_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux hostnamectl plugin" do
let(:plugin) { get_plugin("linux/hostnamectl") }
diff --git a/spec/unit/plugins/linux/kernel_spec.rb b/spec/unit/plugins/linux/kernel_spec.rb
index 18646156..5b24cc34 100644
--- a/spec/unit/plugins/linux/kernel_spec.rb
+++ b/spec/unit/plugins/linux/kernel_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux kernel plugin" do
before(:each) do
diff --git a/spec/unit/plugins/linux/lsb_spec.rb b/spec/unit/plugins/linux/lsb_spec.rb
index 309133d3..ab976d4b 100644
--- a/spec/unit/plugins/linux/lsb_spec.rb
+++ b/spec/unit/plugins/linux/lsb_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
# We do not alter case for lsb attributes and consume them as provided
diff --git a/spec/unit/plugins/linux/machineid_spec.rb b/spec/unit/plugins/linux/machineid_spec.rb
index 12267079..6e0243bc 100644
--- a/spec/unit/plugins/linux/machineid_spec.rb
+++ b/spec/unit/plugins/linux/machineid_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Machine id plugin" do
let(:plugin) { get_plugin("linux/machineid") }
diff --git a/spec/unit/plugins/linux/mdadm_spec.rb b/spec/unit/plugins/linux/mdadm_spec.rb
index 2e8b533d..8b0d9973 100644
--- a/spec/unit/plugins/linux/mdadm_spec.rb
+++ b/spec/unit/plugins/linux/mdadm_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux Mdadm Plugin" do
before(:each) do
diff --git a/spec/unit/plugins/linux/memory_spec.rb b/spec/unit/plugins/linux/memory_spec.rb
index 3a30ead3..e3a281ea 100644
--- a/spec/unit/plugins/linux/memory_spec.rb
+++ b/spec/unit/plugins/linux/memory_spec.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux memory plugin" do
before(:each) do
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index 4b88ebe2..03b16d9f 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -17,14 +17,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-
-begin
- require "ipaddress"
-rescue LoadError => e
- puts "The linux network plugin spec tests will fail without the 'ipaddress' library/gem.\n\n"
- raise e
-end
+require_relative "../../../spec_helper.rb"
+require "ipaddress"
describe Ohai::System, "Linux Network Plugin" do
let(:plugin) { get_plugin("linux/network") }
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index 47d81e23..5066d209 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux plugin platform" do
diff --git a/spec/unit/plugins/linux/sessions_spec.rb b/spec/unit/plugins/linux/sessions_spec.rb
index 89130142..f301df20 100644
--- a/spec/unit/plugins/linux/sessions_spec.rb
+++ b/spec/unit/plugins/linux/sessions_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux sessions plugin" do
let(:plugin) { get_plugin("linux/sessions") }
diff --git a/spec/unit/plugins/linux/uptime_spec.rb b/spec/unit/plugins/linux/uptime_spec.rb
index 4bdc46de..bb8b5f20 100644
--- a/spec/unit/plugins/linux/uptime_spec.rb
+++ b/spec/unit/plugins/linux/uptime_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux plugin uptime" do
before(:each) do
diff --git a/spec/unit/plugins/linux/virtualization_spec.rb b/spec/unit/plugins/linux/virtualization_spec.rb
index da4ecf90..eb0e7860 100644
--- a/spec/unit/plugins/linux/virtualization_spec.rb
+++ b/spec/unit/plugins/linux/virtualization_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Linux virtualization platform" do
let(:plugin) { get_plugin("linux/virtualization") }
diff --git a/spec/unit/plugins/lua_spec.rb b/spec/unit/plugins/lua_spec.rb
index c994ef17..46a98574 100644
--- a/spec/unit/plugins/lua_spec.rb
+++ b/spec/unit/plugins/lua_spec.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin lua" do
diff --git a/spec/unit/plugins/mono_spec.rb b/spec/unit/plugins/mono_spec.rb
index a45f57ed..d8547017 100644
--- a/spec/unit/plugins/mono_spec.rb
+++ b/spec/unit/plugins/mono_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin mono" do
let(:plugin) { get_plugin("mono") }
diff --git a/spec/unit/plugins/netbsd/hostname_spec.rb b/spec/unit/plugins/netbsd/hostname_spec.rb
index 4486a4c9..d6e94e87 100644
--- a/spec/unit/plugins/netbsd/hostname_spec.rb
+++ b/spec/unit/plugins/netbsd/hostname_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "NetBSD hostname plugin" do
before(:each) do
diff --git a/spec/unit/plugins/netbsd/kernel_spec.rb b/spec/unit/plugins/netbsd/kernel_spec.rb
index 6b716efc..9d45226a 100644
--- a/spec/unit/plugins/netbsd/kernel_spec.rb
+++ b/spec/unit/plugins/netbsd/kernel_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "NetBSD kernel plugin" do
before(:each) do
diff --git a/spec/unit/plugins/netbsd/platform_spec.rb b/spec/unit/plugins/netbsd/platform_spec.rb
index 37da17ab..48e54af5 100644
--- a/spec/unit/plugins/netbsd/platform_spec.rb
+++ b/spec/unit/plugins/netbsd/platform_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "NetBSD plugin platform" do
before(:each) do
diff --git a/spec/unit/plugins/network_spec.rb b/spec/unit/plugins/network_spec.rb
index 31780b57..99c1ec34 100644
--- a/spec/unit/plugins/network_spec.rb
+++ b/spec/unit/plugins/network_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
def it_doesnt_fail
it "doesnt fail" do
diff --git a/spec/unit/plugins/nodejs_spec.rb b/spec/unit/plugins/nodejs_spec.rb
index a87d5b05..cd0d377d 100644
--- a/spec/unit/plugins/nodejs_spec.rb
+++ b/spec/unit/plugins/nodejs_spec.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin nodejs" do
diff --git a/spec/unit/plugins/ohai_spec.rb b/spec/unit/plugins/ohai_spec.rb
index 530df962..f7f1f23c 100644
--- a/spec/unit/plugins/ohai_spec.rb
+++ b/spec/unit/plugins/ohai_spec.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin ohai" do
before(:each) do
diff --git a/spec/unit/plugins/ohai_time_spec.rb b/spec/unit/plugins/ohai_time_spec.rb
index e1fe0e48..7f2c8585 100644
--- a/spec/unit/plugins/ohai_time_spec.rb
+++ b/spec/unit/plugins/ohai_time_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin ohai_time" do
before(:each) do
diff --git a/spec/unit/plugins/openbsd/hostname_spec.rb b/spec/unit/plugins/openbsd/hostname_spec.rb
index d2d320a0..cfc33309 100644
--- a/spec/unit/plugins/openbsd/hostname_spec.rb
+++ b/spec/unit/plugins/openbsd/hostname_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "OpenBSD hostname plugin" do
before(:each) do
diff --git a/spec/unit/plugins/openbsd/kernel_spec.rb b/spec/unit/plugins/openbsd/kernel_spec.rb
index f80de3bb..8d48ac7a 100644
--- a/spec/unit/plugins/openbsd/kernel_spec.rb
+++ b/spec/unit/plugins/openbsd/kernel_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "OpenBSD kernel plugin" do
before(:each) do
diff --git a/spec/unit/plugins/openbsd/platform_spec.rb b/spec/unit/plugins/openbsd/platform_spec.rb
index 3c3759ae..985aaf38 100644
--- a/spec/unit/plugins/openbsd/platform_spec.rb
+++ b/spec/unit/plugins/openbsd/platform_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "OpenBSD plugin platform" do
before(:each) do
diff --git a/spec/unit/plugins/openstack_spec.rb b/spec/unit/plugins/openstack_spec.rb
index fcca9a33..8d94ea1f 100644
--- a/spec/unit/plugins/openstack_spec.rb
+++ b/spec/unit/plugins/openstack_spec.rb
@@ -16,10 +16,9 @@
# limitations under the License.
#
-require "spec_helper"
-require "ohai/plugins/openstack"
+require_relative "../../spec_helper.rb"
-describe "OpenStack Plugin" do
+describe Ohai::System, "plugin openstack" do
let(:plugin) { get_plugin("openstack") }
diff --git a/spec/unit/plugins/os_spec.rb b/spec/unit/plugins/os_spec.rb
index 3cff244d..ea15013e 100644
--- a/spec/unit/plugins/os_spec.rb
+++ b/spec/unit/plugins/os_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
ORIGINAL_CONFIG_HOST_OS = ::RbConfig::CONFIG["host_os"]
diff --git a/spec/unit/plugins/packages_spec.rb b/spec/unit/plugins/packages_spec.rb
index ac1e5a26..ad8c21a3 100644
--- a/spec/unit/plugins/packages_spec.rb
+++ b/spec/unit/plugins/packages_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin packages" do
context "on debian" do
diff --git a/spec/unit/plugins/passwd_spec.rb b/spec/unit/plugins/passwd_spec.rb
index b6559989..fc4451be 100644
--- a/spec/unit/plugins/passwd_spec.rb
+++ b/spec/unit/plugins/passwd_spec.rb
@@ -1,4 +1,20 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+#
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin etc", :unix_only do
before(:each) do
diff --git a/spec/unit/plugins/perl_spec.rb b/spec/unit/plugins/perl_spec.rb
index 47bd686f..b5fd2f42 100644
--- a/spec/unit/plugins/perl_spec.rb
+++ b/spec/unit/plugins/perl_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin perl" do
let(:plugin) { get_plugin("perl") }
diff --git a/spec/unit/plugins/php_spec.rb b/spec/unit/plugins/php_spec.rb
index cc2542ae..c8ed8423 100644
--- a/spec/unit/plugins/php_spec.rb
+++ b/spec/unit/plugins/php_spec.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin php" do
let(:plugin) { get_plugin("php") }
diff --git a/spec/unit/plugins/platform_spec.rb b/spec/unit/plugins/platform_spec.rb
index 7e841c3f..9cd508f3 100644
--- a/spec/unit/plugins/platform_spec.rb
+++ b/spec/unit/plugins/platform_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin platform" do
before(:each) do
diff --git a/spec/unit/plugins/powershell_spec.rb b/spec/unit/plugins/powershell_spec.rb
index 43ecbee9..ffc6c65d 100644
--- a/spec/unit/plugins/powershell_spec.rb
+++ b/spec/unit/plugins/powershell_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin powershell" do
let(:plugin) { get_plugin("powershell") }
diff --git a/spec/unit/plugins/python_spec.rb b/spec/unit/plugins/python_spec.rb
index 8e9fb478..d92f0f45 100644
--- a/spec/unit/plugins/python_spec.rb
+++ b/spec/unit/plugins/python_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin python" do
let(:stdout) { "2.5.2 (r252:60911, Jan 4 2009, 17:40:26)\n[GCC 4.3.2]\n" }
diff --git a/spec/unit/plugins/rackspace_spec.rb b/spec/unit/plugins/rackspace_spec.rb
index 76dc34bf..eadd0052 100644
--- a/spec/unit/plugins/rackspace_spec.rb
+++ b/spec/unit/plugins/rackspace_spec.rb
@@ -16,8 +16,7 @@
#
require "resolv"
-
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin rackspace" do
let(:plugin) { get_plugin("rackspace") }
diff --git a/spec/unit/plugins/root_group_spec.rb b/spec/unit/plugins/root_group_spec.rb
index 67ee4c11..dfe4e16c 100644
--- a/spec/unit/plugins/root_group_spec.rb
+++ b/spec/unit/plugins/root_group_spec.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path(File.dirname(__FILE__) + "/../../../lib/ohai/util/win32/group_helper.rb")
+require_relative "../../spec_helper.rb"
+require "ohai/util/win32/group_helper"
describe Ohai::System, "root_group" do
before(:each) do
diff --git a/spec/unit/plugins/ruby_spec.rb b/spec/unit/plugins/ruby_spec.rb
index 9acb35b6..b0404132 100644
--- a/spec/unit/plugins/ruby_spec.rb
+++ b/spec/unit/plugins/ruby_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
ruby_bin = File.join(::RbConfig::CONFIG["bindir"], ::RbConfig::CONFIG["ruby_install_name"])
diff --git a/spec/unit/plugins/rust_spec.rb b/spec/unit/plugins/rust_spec.rb
index daa45d48..e8ffdc6e 100644
--- a/spec/unit/plugins/rust_spec.rb
+++ b/spec/unit/plugins/rust_spec.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin rust" do
let(:stdout) { "rustc 1.0.0-nightly (29bd9a06e 2015-01-20 23:03:09 +0000)" }
diff --git a/spec/unit/plugins/scala_spec.rb b/spec/unit/plugins/scala_spec.rb
index f85c577c..8831e712 100644
--- a/spec/unit/plugins/scala_spec.rb
+++ b/spec/unit/plugins/scala_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin scala" do
diff --git a/spec/unit/plugins/shard_spec.rb b/spec/unit/plugins/shard_spec.rb
index 5d6ef066..b8945660 100644
--- a/spec/unit/plugins/shard_spec.rb
+++ b/spec/unit/plugins/shard_spec.rb
@@ -17,7 +17,7 @@
#
require "digest/md5"
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "shard plugin" do
let(:plugin) { get_plugin("shard") }
diff --git a/spec/unit/plugins/shells_spec.rb b/spec/unit/plugins/shells_spec.rb
index 4c0381aa..13347767 100644
--- a/spec/unit/plugins/shells_spec.rb
+++ b/spec/unit/plugins/shells_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin shells" do
let(:plugin) { get_plugin("shells") }
diff --git a/spec/unit/plugins/softlayer_spec.rb b/spec/unit/plugins/softlayer_spec.rb
index 1734b83d..45e63f57 100644
--- a/spec/unit/plugins/softlayer_spec.rb
+++ b/spec/unit/plugins/softlayer_spec.rb
@@ -17,7 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin softlayer" do
let(:plugin) { get_plugin("softlayer") }
diff --git a/spec/unit/plugins/solaris2/cpu_spec.rb b/spec/unit/plugins/solaris2/cpu_spec.rb
index c183b796..86b6b028 100644
--- a/spec/unit/plugins/solaris2/cpu_spec.rb
+++ b/spec/unit/plugins/solaris2/cpu_spec.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Solaris2.X cpu plugin" do
before(:each) do
diff --git a/spec/unit/plugins/solaris2/dmi_spec.rb b/spec/unit/plugins/solaris2/dmi_spec.rb
index 261c4431..5ab477c9 100644
--- a/spec/unit/plugins/solaris2/dmi_spec.rb
+++ b/spec/unit/plugins/solaris2/dmi_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
SOLARIS_DMI_OUT = <<-EOS
ID SIZE TYPE
diff --git a/spec/unit/plugins/solaris2/hostname_spec.rb b/spec/unit/plugins/solaris2/hostname_spec.rb
index 6b793abe..707ef687 100644
--- a/spec/unit/plugins/solaris2/hostname_spec.rb
+++ b/spec/unit/plugins/solaris2/hostname_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Solaris2.X hostname plugin" do
before(:each) do
diff --git a/spec/unit/plugins/solaris2/kernel_spec.rb b/spec/unit/plugins/solaris2/kernel_spec.rb
index cb2822b1..98be16cd 100644
--- a/spec/unit/plugins/solaris2/kernel_spec.rb
+++ b/spec/unit/plugins/solaris2/kernel_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Solaris2.X kernel plugin" do
# NOTE: Solaris will report the same module loaded multiple times
diff --git a/spec/unit/plugins/solaris2/memory_spec.rb b/spec/unit/plugins/solaris2/memory_spec.rb
index 101dcd3d..c64ae2c4 100644
--- a/spec/unit/plugins/solaris2/memory_spec.rb
+++ b/spec/unit/plugins/solaris2/memory_spec.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Solaris2.X memory plugin" do
before(:each) do
diff --git a/spec/unit/plugins/solaris2/network_spec.rb b/spec/unit/plugins/solaris2/network_spec.rb
index caa444dc..3755c183 100644
--- a/spec/unit/plugins/solaris2/network_spec.rb
+++ b/spec/unit/plugins/solaris2/network_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Solaris2.X network plugin" do
diff --git a/spec/unit/plugins/solaris2/platform_spec.rb b/spec/unit/plugins/solaris2/platform_spec.rb
index 1c813f72..f2394609 100644
--- a/spec/unit/plugins/solaris2/platform_spec.rb
+++ b/spec/unit/plugins/solaris2/platform_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Solaris plugin platform" do
before(:each) do
diff --git a/spec/unit/plugins/solaris2/virtualization_spec.rb b/spec/unit/plugins/solaris2/virtualization_spec.rb
index e0f950e3..d8c0a5fe 100644
--- a/spec/unit/plugins/solaris2/virtualization_spec.rb
+++ b/spec/unit/plugins/solaris2/virtualization_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Solaris virtualization platform" do
before(:each) do
diff --git a/spec/unit/plugins/solaris2/zpools_spec.rb b/spec/unit/plugins/solaris2/zpools_spec.rb
index b53b659b..fdc94bc4 100644
--- a/spec/unit/plugins/solaris2/zpools_spec.rb
+++ b/spec/unit/plugins/solaris2/zpools_spec.rb
@@ -13,7 +13,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Solaris 2.x zpool plugin" do
before(:each) do
diff --git a/spec/unit/plugins/ssh_host_keys_spec.rb b/spec/unit/plugins/ssh_host_keys_spec.rb
index 7bdf90d8..cf8de1ac 100644
--- a/spec/unit/plugins/ssh_host_keys_spec.rb
+++ b/spec/unit/plugins/ssh_host_keys_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
describe Ohai::System, "ssh_host_key plugin" do
diff --git a/spec/unit/plugins/sysconf_spec.rb b/spec/unit/plugins/sysconf_spec.rb
index e2f6f361..3edf600a 100644
--- a/spec/unit/plugins/sysconf_spec.rb
+++ b/spec/unit/plugins/sysconf_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "sysconf plugin", :unix_only do
let(:plugin) { get_plugin("sysconf") }
diff --git a/spec/unit/plugins/timezone_spec.rb b/spec/unit/plugins/timezone_spec.rb
index 62fcb0ef..29368a8b 100644
--- a/spec/unit/plugins/timezone_spec.rb
+++ b/spec/unit/plugins/timezone_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper.rb"
describe Ohai::System, "timezone plugin" do
before(:each) do
diff --git a/spec/unit/plugins/virtualbox_spec.rb b/spec/unit/plugins/virtualbox_spec.rb
index 49e2268f..ff00c37b 100644
--- a/spec/unit/plugins/virtualbox_spec.rb
+++ b/spec/unit/plugins/virtualbox_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
+require_relative "../../spec_helper.rb"
vbox_output = <<EOF
Oracle VM VirtualBox Guest Additions Command Line Management Interface Version 5.0.2
diff --git a/spec/unit/plugins/vmware_spec.rb b/spec/unit/plugins/vmware_spec.rb
index bcaf17bf..7ea04619 100644
--- a/spec/unit/plugins/vmware_spec.rb
+++ b/spec/unit/plugins/vmware_spec.rb
@@ -14,7 +14,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-require "spec_helper"
+
+require_relative "../../spec_helper.rb"
describe Ohai::System, "plugin vmware" do
let(:plugin) { get_plugin("vmware") }
diff --git a/spec/unit/plugins/windows/cpu_spec.rb b/spec/unit/plugins/windows/cpu_spec.rb
index b4393e82..0f18a1b9 100644
--- a/spec/unit/plugins/windows/cpu_spec.rb
+++ b/spec/unit/plugins/windows/cpu_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
shared_examples "a cpu" do |cpu_no|
describe "cpu #{cpu_no}" do
diff --git a/spec/unit/plugins/windows/fips_spec.rb b/spec/unit/plugins/windows/fips_spec.rb
index 29138082..19482993 100644
--- a/spec/unit/plugins/windows/fips_spec.rb
+++ b/spec/unit/plugins/windows/fips_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "plugin fips", :windows_only do
let(:enabled) { 0 }
diff --git a/spec/unit/plugins/windows/memory_spec.rb b/spec/unit/plugins/windows/memory_spec.rb
index 0579439b..d429435b 100644
--- a/spec/unit/plugins/windows/memory_spec.rb
+++ b/spec/unit/plugins/windows/memory_spec.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Windows memory plugin", :windows_only do
before do
diff --git a/spec/unit/plugins/windows/uptime_spec.rb b/spec/unit/plugins/windows/uptime_spec.rb
index 05d2fd2f..2cede79b 100644
--- a/spec/unit/plugins/windows/uptime_spec.rb
+++ b/spec/unit/plugins/windows/uptime_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Windows plugin uptime" do
diff --git a/spec/unit/plugins/windows/virtualization_spec.rb b/spec/unit/plugins/windows/virtualization_spec.rb
index 87ed4712..49d4446e 100644
--- a/spec/unit/plugins/windows/virtualization_spec.rb
+++ b/spec/unit/plugins/windows/virtualization_spec.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require_relative "../../../spec_helper.rb"
describe Ohai::System, "Windows virtualization platform" do
let(:plugin) { get_plugin("windows/virtualization") }
diff --git a/spec/unit/provides_map_spec.rb b/spec/unit/provides_map_spec.rb
index 5a6eb1fe..fc5551ef 100644
--- a/spec/unit/provides_map_spec.rb
+++ b/spec/unit/provides_map_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License
#
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper.rb"
describe Ohai::ProvidesMap do
diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb
index abbeecd3..a811c954 100644
--- a/spec/unit/runner_spec.rb
+++ b/spec/unit/runner_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License
#
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper.rb"
describe Ohai::Runner, "run_plugin" do
let(:safe_run) { true }
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb
index ac2405c7..f184d8ee 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper.rb"
require "ohai/mixin/os"
describe "Ohai::System" do
diff --git a/spec/unit/util/file_helper_spec.rb b/spec/unit/util/file_helper_spec.rb
index f6c91cb1..1142ab8e 100644
--- a/spec/unit/util/file_helper_spec.rb
+++ b/spec/unit/util/file_helper_spec.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "spec_helper"
+require_relative "../../spec_helper.rb"
require "ohai/util/file_helper"
class FileHelperMock
diff --git a/spec/unit/util/ip_helper_spec.rb b/spec/unit/util/ip_helper_spec.rb
index 0532cbc9..bf6a4f22 100644
--- a/spec/unit/util/ip_helper_spec.rb
+++ b/spec/unit/util/ip_helper_spec.rb
@@ -15,7 +15,7 @@
# limitations under the License.
require "ipaddress"
-require "spec_helper"
+require_relative "../../spec_helper.rb"
require "ohai/util/ip_helper"
class IpHelperMock