diff options
Diffstat (limited to 'spec/unit/resource/ohai_spec.rb')
-rw-r--r-- | spec/unit/resource/ohai_spec.rb | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/spec/unit/resource/ohai_spec.rb b/spec/unit/resource/ohai_spec.rb index 9669ef193d..eb569aa3b7 100644 --- a/spec/unit/resource/ohai_spec.rb +++ b/spec/unit/resource/ohai_spec.rb @@ -20,41 +20,34 @@ require "spec_helper" describe Chef::Resource::Ohai do - before(:each) do - @resource = Chef::Resource::Ohai.new("ohai_reload") - end - - 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) - end + let(:resource) { Chef::Resource::Ohai.new("ohai_reload") } - 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 create" 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 + 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 |