summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Doherty <cdoherty@getchef.com>2014-09-03 16:29:29 -0700
committerChris Doherty <cdoherty@getchef.com>2014-09-10 16:34:18 -0700
commita95d518c810cea761fe529c2cfd2dce7e4afe570 (patch)
treea4ff8fcbd202e329ebc7b19739eaab4bd9287a57
parentb33f55c555a68d559f32b216c18d25c5b8cb80ac (diff)
downloadchef-a95d518c810cea761fe529c2cfd2dce7e4afe570.tar.gz
Add unit spec for reboot data in RunContext.
-rw-r--r--spec/unit/run_context_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/run_context_spec.rb b/spec/unit/run_context_spec.rb
index 1def10faf5..21ece2abaa 100644
--- a/spec/unit/run_context_spec.rb
+++ b/spec/unit/run_context_spec.rb
@@ -134,4 +134,19 @@ describe Chef::RunContext do
end
end
+ describe "handling reboot requests" do
+ let(:expected) do
+ { :reason => "spec tests require a reboot" }
+ end
+
+ it "stores and deletes the reboot request" do
+ @run_context.request_reboot(expected)
+ expect(@run_context.reboot_info).to eq(expected)
+ expect(@run_context.reboot_requested?).to be_true
+
+ @run_context.cancel_reboot
+ expect(@run_context.reboot_info).to eq({})
+ expect(@run_context.reboot_requested?).to be_false
+ end
+ end
end