Commit a5dde103 authored by James Casey's avatar James Casey
Browse files

Add default value for event_handler to Chef::Config

This is a back-port of CHEF-4363
parent 379d177d
......@@ -293,6 +293,9 @@ class Chef
# Report Handlers
report_handlers []
# Event Handlers
event_handlers []
# Exception Handlers
exception_handlers []
......
......@@ -50,7 +50,7 @@ describe Chef::Config do
before do
Chef::Config.chef_server_url = "https://junglist.gen.nz"
end
it_behaves_like "server URL"
end
......@@ -58,7 +58,7 @@ describe Chef::Config do
before do
Chef::Config.chef_server_url = " https://junglist.gen.nz"
end
it_behaves_like "server URL"
end
......@@ -217,6 +217,17 @@ describe Chef::Config do
end
end
describe "Chef::Config[:event_handlers]" do
it "sets a event_handlers to an empty array by default" do
Chef::Config[:event_handlers].should eq([])
end
it "should be able to add custom handlers" do
o = Object.new
Chef::Config[:event_handlers] << o
Chef::Config[:event_handlers].should be_include(o)
end
end
after(:each) do
Chef::Config.configuration = @original_config
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment