Permalink
Browse files

testing yaml auto config for including yamlconfig

  • Loading branch information...
1 parent 61010ba commit e711d7e9879b0ccd6e9336c6bec93b2c3a169335 @derickbailey committed Oct 19, 2009
Showing with 18 additions and 1 deletion.
  1. +1 −1 lib/albacore/support/yamlconfig.rb
  2. +1 −0 spec/yaml_autoconfig_test.yml
  3. +15 −0 spec/yamlconfig_spec.rb
  4. +1 −0 yaml_autoconfig_test.yml
@@ -1,6 +1,6 @@
require 'yaml'
-module YAMLConfig
+module YAMLConfig
def initialize
super()
configure_if_config_exists(self.class.to_s.downcase)
@@ -0,0 +1 @@
+this_attr_was_automatically_added_by: the yaml auto config
@@ -29,4 +29,19 @@ class YamlTest
it "should allow symbols" do
@yml.what_ever.should == :a_symbol
end
+end
+
+describe YAMLConfig, "when included yamlconfig in a class" do
+
+ class YAML_AutoConfig_Test
+ include YAMLConfig
+ end
+
+ before :all do
+ @yamltest = YAML_AutoConfig_Test.new
+ end
+
+ it "should automatically configure the class through a yaml file named after the class" do
+ @yamltest.this_attr_was_automatically_added_by.should == "the yaml auto config"
+ end
end
@@ -0,0 +1 @@
+this_attr_was_automatically_added_by: the yaml auto config

0 comments on commit e711d7e

Please sign in to comment.