summaryrefslogtreecommitdiff
path: root/spec/unit/resource/ohai_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/resource/ohai_spec.rb')
-rw-r--r--spec/unit/resource/ohai_spec.rb32
1 files changed, 15 insertions, 17 deletions
diff --git a/spec/unit/resource/ohai_spec.rb b/spec/unit/resource/ohai_spec.rb
index 574c09eeba..fdd38ecf39 100644
--- a/spec/unit/resource/ohai_spec.rb
+++ b/spec/unit/resource/ohai_spec.rb
@@ -20,41 +20,39 @@ require "spec_helper"
describe Chef::Resource::Ohai do
- before(:each) do
- @resource = Chef::Resource::Ohai.new("ohai_reload")
- end
+ let(:resource) { Chef::Resource::Ohai.new("ohai_reload") }
- it "should create a new Chef::Resource::Ohai" do
- expect(@resource).to be_a_kind_of(Chef::Resource)
- expect(@resource).to be_a_kind_of(Chef::Resource::Ohai)
+ it "creates a new Chef::Resource::Ohai" do
+ expect(resource).to be_a_kind_of(Chef::Resource)
+ expect(resource).to be_a_kind_of(Chef::Resource::Ohai)
end
- it "should have a resource name of :ohai" do
- expect(@resource.resource_name).to eql(:ohai)
+ it "has a resource name of :ohai" do
+ expect(resource.resource_name).to eql(:ohai)
end
- it "should have a default action of reload" do
- expect(@resource.action).to eql([:reload])
+ it "has a default action of reload" do
+ expect(resource.action).to eql([:reload])
end
- it "should allow you to set the plugin attribute" do
- @resource.plugin "passwd"
- expect(@resource.plugin).to eql("passwd")
+ it "allows you to set the plugin attribute" do
+ resource.plugin "passwd"
+ expect(resource.plugin).to eql("passwd")
end
describe "when it has a plugin value" do
before do
- @resource.name("test")
- @resource.plugin("passwd")
+ resource.name("test")
+ resource.plugin("passwd")
end
it "describes its state" do
- state = @resource.state_for_resource_reporter
+ state = resource.state_for_resource_reporter
expect(state[:plugin]).to eq("passwd")
end
it "returns the name as its identity" do
- expect(@resource.identity).to eq("test")
+ expect(resource.identity).to eq("test")
end
end