summaryrefslogtreecommitdiff
path: root/spec/unit/config_spec.rb
diff options
context:
space:
mode:
authorRanjib Dey <dey.ranjib@gmail.com>2013-07-09 12:39:15 -0700
committerBryan McLellan <btm@opscode.com>2013-11-06 09:13:46 -0800
commit11572f73a01621a171fa1c302aee711541cec931 (patch)
tree056d56b269d695e53f178237255aa169fcf4c6af /spec/unit/config_spec.rb
parentf16fe644dea2497e7512724ad71bfe877dfa312e (diff)
downloadchef-11572f73a01621a171fa1c302aee711541cec931.tar.gz
[CHEF-4363] Allow adding event_handlers via config file
Diffstat (limited to 'spec/unit/config_spec.rb')
-rw-r--r--spec/unit/config_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 0a246037fb..e599e9cb6c 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -360,4 +360,18 @@ describe Chef::Config do
expect{Chef::Config.log_location = missing_path}.to raise_error Chef::Exceptions::ConfigurationError
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
end