test/deploy_test.rb in eb_deployer-0.3.3 vs test/deploy_test.rb in eb_deployer-0.3.4
- old
+ new
@@ -401,9 +401,26 @@
s3_objects = @s3_driver.objects('thoughtworks.simple.packages')
assert_equal 1, s3_objects.size
assert_equal @sample_package, s3_objects.values.first.to_s
end
+ def test_sets_default_tier_as_webserver
+ deploy(:application => 'simple', :environment => "production")
+ assert_equal EbDeployer.environment_tier('WebServer'), @eb_driver.environment_tier('simple', eb_envname('simple', 'production'))
+ end
+
+ def test_can_change_tier
+ deploy(:application => 'simple', :environment => "production", :tier => 'Worker')
+ assert_equal EbDeployer.environment_tier('Worker'), @eb_driver.environment_tier('simple', eb_envname('simple', 'production'))
+ end
+
+ def test_should_raise_error_when_tier_setting_is_not_recognized
+ assert_raises(RuntimeError) do
+ deploy(:application => 'simple', :environment => "production", :tier => 'Gum')
+ end
+ end
+
+
private
def temp_file(content)
f = Tempfile.new("foo")
f.write(content)