summaryrefslogtreecommitdiff
path: root/spec/unit/resource/reboot_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/resource/reboot_spec.rb')
-rw-r--r--spec/unit/resource/reboot_spec.rb32
1 files changed, 15 insertions, 17 deletions
diff --git a/spec/unit/resource/reboot_spec.rb b/spec/unit/resource/reboot_spec.rb
index 36e9f705a1..4cd959d2db 100644
--- a/spec/unit/resource/reboot_spec.rb
+++ b/spec/unit/resource/reboot_spec.rb
@@ -19,34 +19,32 @@ require "spec_helper"
describe Chef::Resource::Reboot do
- before(:each) do
- @resource = Chef::Resource::Reboot.new("reboot me!")
- end
+ let(:resource) { Chef::Resource::Reboot.new("reboot me!") }
- it "should create a new Chef::Resource::Reboot" do
- expect(@resource).to be_a_kind_of(Chef::Resource)
- expect(@resource).to be_a_kind_of(Chef::Resource::Reboot)
+ it "creates a new Chef::Resource::Reboot" do
+ expect(resource).to be_a_kind_of(Chef::Resource)
+ expect(resource).to be_a_kind_of(Chef::Resource::Reboot)
end
- it "should have a default action of :nothing" do
- expect(@resource.action).to eql([:nothing])
+ it "has a default action of :nothing" do
+ expect(resource.action).to eql([:nothing])
end
it "supports the :nothing, :request_reboot, :reboot_now, and :cancel actions" do
- expect(@resource.allowed_actions).to include(:nothing, :request_reboot, :reboot_now, :cancel)
+ expect(resource.allowed_actions).to include(:nothing, :request_reboot, :reboot_now, :cancel)
end
- it "should have a resource_name of :reboot" do
- expect(@resource.resource_name).to eq(:reboot)
+ it "has a resource_name of :reboot" do
+ expect(resource.resource_name).to eq(:reboot)
end
- it "should accept a String for the reboot reason" do
- @resource.reason "reasons"
- expect(@resource.reason).to eq("reasons")
+ it "accepts a String for the reboot reason" do
+ resource.reason "reasons"
+ expect(resource.reason).to eq("reasons")
end
- it "should accept an Integer for delay_mins" do
- @resource.delay_mins 100
- expect { @resource.delay_mins "100" }.to raise_error(ArgumentError)
+ it "accepts an Integer for delay_mins" do
+ resource.delay_mins 100
+ expect { resource.delay_mins "100" }.to raise_error(ArgumentError)
end
end