test/poolparty/modules/cloud_dsl_test.rb in fairchild-poolparty-1.1.5 vs test/poolparty/modules/cloud_dsl_test.rb in fairchild-poolparty-1.2.12
- old
+ new
@@ -2,11 +2,12 @@
class TestCloudDsl < Test::Unit::TestCase
context "enabling and disabling" do
setup do
reset!
- @cloud = cloud :test_cloud_dsl
+ @cloud = cloud :test_cloud_dsl do
+ end
end
should "not have an option set for hyper_drive" do
@cloud.dsl_options[:hyper_drive].should == nil
end
@@ -19,22 +20,24 @@
@cloud.disable :hyper_drive
@cloud.dsl_options[:hyper_drive].should == :disabled
end
should "be able to check if they are enabled" do
- @cloud.enable :hyper_drive
- @cloud.enabled?(:hyper_drive).should == true
+ @cloud.enable :hyper_slam
+ @cloud.enabled?(:hyper_slam).should == true
end
should "be able to check that they are disabled" do
- @cloud.disable :hyper_drive
- @cloud.enabled?(:hyper_drive).should == false
+ @cloud.disable :hyper_slam
+ @cloud.enabled?(:hyper_slam).should == false
end
end
context "calling add_optional_enabled_services" do
setup do
reset!
- @cloud = cloud :test_cloud_dsl_2
+ @cloud = cloud :test_cloud_dsl_2 do
+ enable :haproxy
+ end
@cloud.instance_eval "self.class.send :attr_reader, :brains"
@cloud.instance_eval "def box;@brains = 'pepper';end"
end
should "send @cloud the method box after it's been enabled" do
@@ -45,13 +48,12 @@
should "not call box if the method has not been enabled" do
@cloud.add_optional_enabled_services
@cloud.brains.should == nil
end
should "call haproxy when adding enabled serivces" do
- @cloud.enable :haproxy
@cloud.add_optional_enabled_services
klasses = @cloud.plugin_store.map {|a| a.class.to_s.split("::")[-1] }
- klasses.include?("HaproxyClass").should == true
+ klasses.include?("Haproxy").should == true
end
end
end
\ No newline at end of file