zenslap 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/zenslap/commands.rb +3 -1
- data/spec/commands_spec.rb +6 -0
- data/zenslap.gemspec +1 -1
- metadata +3 -3
data/lib/zenslap/commands.rb
CHANGED
@@ -38,7 +38,9 @@ module Zenslap
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def test_environment_name(name, owner)
|
41
|
-
"#{name}-zenslap-#{owner}".gsub(/[^a-zA-Z\d-]/, '-')
|
41
|
+
full_name = "#{name}-zenslap-#{owner}".gsub(/[^a-zA-Z\d-]/, '-')
|
42
|
+
return full_name if full_name.length <= 30
|
43
|
+
return full_name[0, 27].gsub(/-+$/, "") + "-" + rand(99).to_s
|
42
44
|
end
|
43
45
|
|
44
46
|
def create
|
data/spec/commands_spec.rb
CHANGED
@@ -56,6 +56,12 @@ module ZenslapSpec
|
|
56
56
|
stub_zenslap
|
57
57
|
stub_heroku
|
58
58
|
end
|
59
|
+
|
60
|
+
it "should ensure test environment names have a maximum of 30 characters" do
|
61
|
+
name = @command.test_environment_name("delayed_job_groups_mongoid", "opsb")
|
62
|
+
name.should match /^delayed-job-groups-mongoid-\d+/
|
63
|
+
name.length.should be <= 30
|
64
|
+
end
|
59
65
|
|
60
66
|
context "#create" do
|
61
67
|
context "when zenslap has already been created" do
|
data/zenslap.gemspec
CHANGED
metadata
CHANGED