diff options
author | Jose Asuncion <jose.asuncion@gmail.com> | 2017-09-08 16:36:54 -0700 |
---|---|---|
committer | Jose Asuncion <jose.asuncion@gmail.com> | 2017-09-08 16:42:23 -0700 |
commit | 5d384cbf5049186795b9c56ecedd03aedde8b81b (patch) | |
tree | 0d292d9287fff160aeca20dcf0205414d11be779 | |
parent | e8c765800ae3409085d86b9e6f38444fb00ff08e (diff) | |
download | ohai-5d384cbf5049186795b9c56ecedd03aedde8b81b.tar.gz |
refactoring
Signed-off-by: Jose Asuncion <jeunito@gmail.com>
-rw-r--r-- | spec/unit/plugins/linux/virtualization_spec.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/spec/unit/plugins/linux/virtualization_spec.rb b/spec/unit/plugins/linux/virtualization_spec.rb index cc9dbac5..ab236a4d 100644 --- a/spec/unit/plugins/linux/virtualization_spec.rb +++ b/spec/unit/plugins/linux/virtualization_spec.rb @@ -573,10 +573,10 @@ CGROUP CGROUP expect(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true) allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup) + allow(File).to receive(:read).with("/proc/1/environ").and_return("") end it "sets lxc host if lxc-version exists" do - allow(File).to receive(:read).with("/proc/1/environ").and_return("") allow(plugin).to receive(:lxc_version_exists?).and_return("/usr/bin/lxc-version") plugin.run expect(plugin[:virtualization][:system]).to eq("lxc") @@ -585,7 +585,6 @@ CGROUP end it "does not set the old virtualization attributes if they are already set" do - allow(File).to receive(:read).with("/proc/1/environ").and_return("") allow(plugin).to receive(:lxc_version_exists?).and_return("/usr/bin/lxc-version") plugin[:virtualization] = Mash.new plugin[:virtualization][:system] = "the cloud" @@ -597,7 +596,6 @@ CGROUP it "does not set lxc host if lxc-version does not exist" do allow(plugin).to receive(:lxc_version_exists?).and_return(false) - allow(File).to receive(:read).with("/proc/1/environ").and_return("") plugin.run expect(plugin[:virtualization][:system]).to be_nil expect(plugin[:virtualization][:role]).to be_nil |