tdd_deploy 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/tdd_deploy_context +1 -1
- data/lib/tdd_deploy/capfile.rb +40 -0
- data/lib/tdd_deploy/environ.rb +85 -25
- data/lib/tdd_deploy/server-templates/test_results.html.erb +2 -2
- data/lib/tdd_deploy/version.rb +1 -1
- data/lib/tdd_deploy.rb +1 -0
- data/tests/test_capfile.rb +51 -0
- data/tests/test_environ.rb +18 -10
- metadata +13 -11
data/bin/tdd_deploy_context
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'capistrano/configuration'
|
2
|
+
|
3
|
+
module TddDeploy
|
4
|
+
# == TddDeploy::Capfile - interface to capistrano capfile
|
5
|
+
#
|
6
|
+
# uses Capistrano to parse recipe file(s) and provides convenient access to server
|
7
|
+
# definitions
|
8
|
+
class Capfile
|
9
|
+
# creates a Capfile::Configuration object to use, but does not read any Capistrano Recipe files
|
10
|
+
def initialize
|
11
|
+
@capfile_config = Capistrano::Configuration.new
|
12
|
+
end
|
13
|
+
|
14
|
+
# returns the Capistrano::Configuration::Roles object
|
15
|
+
def roles
|
16
|
+
@capfile_config.roles
|
17
|
+
end
|
18
|
+
|
19
|
+
# returns list of host strings defined for specified 'role'
|
20
|
+
def role_to_host_list role
|
21
|
+
servers(role).map { |srv| srv.to_s }
|
22
|
+
end
|
23
|
+
|
24
|
+
# returns list of host strings which are in the 'db' role and for which 'primary' is true
|
25
|
+
def migration_host_list
|
26
|
+
servers(:db).select { |srv| srv.options[:primary] == true }.map { |x| x.to_s }
|
27
|
+
end
|
28
|
+
|
29
|
+
# returns the array of Capistrano::ServerDefinition objects defined for 'role'
|
30
|
+
def servers role
|
31
|
+
@capfile_config.roles[role].servers
|
32
|
+
end
|
33
|
+
|
34
|
+
# loads the specified recipie file. Defaults to './config/deploy.rb' which is standard
|
35
|
+
# for rails apps. May be called multiple times
|
36
|
+
def load_recipes(path = './config/deploy.rb')
|
37
|
+
@capfile_config.load path
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/tdd_deploy/environ.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'tdd_deploy/capfile'
|
2
|
+
|
1
3
|
module TddDeploy
|
2
4
|
|
3
5
|
# == module TddDeploy::Environ
|
@@ -37,14 +39,23 @@ module TddDeploy
|
|
37
39
|
# know how to included globbed paths]
|
38
40
|
#
|
39
41
|
# === List Variables
|
42
|
+
# * 'app_hosts' - hosts running a ruby app which must have a ruby available and will be served
|
43
|
+
#via a reverse proxy
|
40
44
|
# * 'balance_hosts' - load balancing servers [may be empty, in which case 'hosts' is used]
|
41
45
|
# * 'db_hosts' - hosts which run the database server [may be empty, in which case 'hosts' is used]
|
42
46
|
# * 'web_hosts' - hosts which run the web server [may be empty, in which case 'hosts' is used]
|
47
|
+
# * 'capfile_paths' - relative paths to capistrano recipe files. Defaults to './config/deploy.rb'
|
43
48
|
#
|
44
|
-
# === Pseudo
|
49
|
+
# === Pseudo Variables
|
45
50
|
# * 'hosts' - list of all hosts - always returns balance_hosts + db_hosts + web_hosts.
|
46
51
|
#may be assigned to if all three host lists are identical, otherwise raises an exception.
|
47
|
-
#
|
52
|
+
#'tdd_deploy_context' hides it from view unless it can be assigned
|
53
|
+
# * 'app' - list of all hosts in the :app role of the Capistrano recipes
|
54
|
+
# * 'db' - list of all hosts in the :db role of the Capistrano recipes
|
55
|
+
# * 'migration_hosts' - list of all hosts in the :db role with option :primary => true
|
56
|
+
#of the Capistrano recipes
|
57
|
+
# * 'web' - list of all hosts in the :web role of the Capistrano recipes
|
58
|
+
|
48
59
|
|
49
60
|
module Environ
|
50
61
|
|
@@ -54,7 +65,7 @@ module TddDeploy
|
|
54
65
|
# include TddDeploy::Environ
|
55
66
|
class DataCache
|
56
67
|
class << self
|
57
|
-
attr_accessor :env_hash, :env_types, :env_defaults
|
68
|
+
attr_accessor :env_hash, :env_types, :env_defaults, :capfile
|
58
69
|
end
|
59
70
|
end
|
60
71
|
|
@@ -77,6 +88,17 @@ module TddDeploy
|
|
77
88
|
DataCache.env_hash = hash
|
78
89
|
end
|
79
90
|
end
|
91
|
+
|
92
|
+
def capfile
|
93
|
+
raise RuntimeError.new('Attempt to access capfile data w/o capfile_paths defined') unless DataCache.env_hash['capfile_paths']
|
94
|
+
unless DataCache.capfile
|
95
|
+
DataCache.capfile = TddDeploy::Capfile.new
|
96
|
+
DataCache.env_hash['capfile_paths'].each do |path|
|
97
|
+
DataCache.capfile.load_recipes path
|
98
|
+
end
|
99
|
+
end
|
100
|
+
DataCache.capfile
|
101
|
+
end
|
80
102
|
|
81
103
|
DataCache.env_types = {
|
82
104
|
'ssh_timeout' => :int,
|
@@ -93,10 +115,17 @@ module TddDeploy
|
|
93
115
|
'site_path' => :string,
|
94
116
|
'site_user' => :string,
|
95
117
|
|
96
|
-
|
118
|
+
'app_hosts' => :list,
|
97
119
|
'balance_hosts' => :list,
|
120
|
+
'capfile_paths' => :list,
|
98
121
|
'db_hosts' => :list,
|
99
122
|
'web_hosts' => :list,
|
123
|
+
|
124
|
+
'hosts' => :pseudo,
|
125
|
+
'app' => :pseudo,
|
126
|
+
'db' => :pseudo,
|
127
|
+
'migration_hosts' => :pseudo,
|
128
|
+
'web' => :pseudo,
|
100
129
|
}
|
101
130
|
|
102
131
|
DataCache.env_defaults ||= {
|
@@ -114,7 +143,10 @@ module TddDeploy
|
|
114
143
|
'site_path' => '/home/site_user/site.d/current', # default for Capistrano
|
115
144
|
'site_user' => "site_user",
|
116
145
|
|
146
|
+
'capfile_paths' => './config/deploy.rb',
|
147
|
+
|
117
148
|
# 'hosts' => "bar,foo",
|
149
|
+
'app_hosts' => 'arch',
|
118
150
|
'balance_hosts' => 'arch',
|
119
151
|
'db_hosts' => 'arch',
|
120
152
|
'web_hosts' => 'arch',
|
@@ -140,19 +172,24 @@ module TddDeploy
|
|
140
172
|
when :int then DataCache.env_hash[k] = v.to_i
|
141
173
|
when :string then DataCache.env_hash[k] = v.to_s
|
142
174
|
when :list then DataCache.env_hash[k] = self.str_to_list(v)
|
143
|
-
|
175
|
+
when :pseudo then
|
144
176
|
if k == 'hosts'
|
145
|
-
if DataCache.env_hash['web_hosts'] == DataCache.env_hash['db_hosts']
|
177
|
+
if (tmp = DataCache.env_hash['web_hosts']) == DataCache.env_hash['db_hosts'] \
|
178
|
+
&& tmp == DataCache.env_hash['balance_hosts'] \
|
179
|
+
&& tmp == DataCache.env_hash['app_hosts']
|
146
180
|
DataCache.env_hash['web_hosts'] =
|
147
181
|
DataCache.env_hash['db_hosts'] =
|
148
|
-
DataCache.env_hash['balance_hosts'] =
|
182
|
+
DataCache.env_hash['balance_hosts'] =
|
183
|
+
DataCache.env_hash['app_hosts'] = self.str_to_list(v)
|
149
184
|
else
|
150
185
|
raise RuntimeError.new("#{self}#reset_env(): Cannot assign value to 'hosts' if web_hosts &/or db_hosts already set.\n web_hosts: #{DataCache.env_hash['web_hosts']}\n db_hosts: #{DataCache.env_hash['db_hosts']}")
|
151
186
|
# raise RuntimeError.new("Cannot change hosts key if web_hosts != db_hosts")
|
152
187
|
end
|
153
188
|
else
|
154
|
-
|
189
|
+
next
|
155
190
|
end
|
191
|
+
else
|
192
|
+
raise ArgumentError.new("#{self}#reset_env(): Illegal environment key: #{k}")
|
156
193
|
end
|
157
194
|
end
|
158
195
|
end
|
@@ -198,7 +235,13 @@ module TddDeploy
|
|
198
235
|
end
|
199
236
|
# add any missing env keys
|
200
237
|
(self.env_types.keys - self.env_hash.keys).each do |key|
|
201
|
-
|
238
|
+
case self.env_types[key]
|
239
|
+
when :pseudo then next
|
240
|
+
when :list
|
241
|
+
self.env_hash[key] = str_to_list(self.env_defaults[key])
|
242
|
+
else
|
243
|
+
self.env_hash[key] = self.env_defaults[key]
|
244
|
+
end
|
202
245
|
end
|
203
246
|
return self.env_hash
|
204
247
|
else
|
@@ -243,31 +286,19 @@ module TddDeploy
|
|
243
286
|
when :string then f.write "#{k}=#{v}\n"
|
244
287
|
when :list then
|
245
288
|
f.write "#{k}=#{self.list_to_str(k)}\n" unless k == 'hosts'
|
289
|
+
when :pseudo then next
|
246
290
|
else
|
247
291
|
raise RuntimeError("unknown key: #{k}")
|
248
292
|
end
|
249
293
|
end
|
250
294
|
f.close
|
251
295
|
end
|
252
|
-
|
253
|
-
# accessors for all defined env variables
|
254
|
-
def hosts
|
255
|
-
(self.web_hosts.to_a + self.db_hosts.to_a + self.balance_hosts.to_a).uniq.sort
|
256
|
-
end
|
257
296
|
|
258
|
-
|
259
|
-
if (self.web_hosts.nil? && self.db_hosts.nil?) || self.web_hosts == self.db_hosts
|
260
|
-
self.web_hosts =
|
261
|
-
self.db_hosts =
|
262
|
-
self.balance_hosts = self.str_to_list(list)
|
263
|
-
else
|
264
|
-
raise RuntimeError.new("Cannot assign value to 'hosts' if web_hosts &/or db_hosts already set.\n web_hosts: #{self.web_hosts}\n db_hosts: #{self.db_hosts}")
|
265
|
-
end
|
266
|
-
end
|
267
|
-
|
268
|
-
# create accessors for all keys in env_types
|
297
|
+
# create accessors for all keys in env_types which are not :pseudo variables
|
269
298
|
tmp = ''
|
270
299
|
DataCache.env_types.each do |k, t|
|
300
|
+
next if t == :pseudo
|
301
|
+
|
271
302
|
tmp +=<<-EOF
|
272
303
|
def #{k}
|
273
304
|
self.env_hash['#{k}']
|
@@ -290,11 +321,40 @@ module TddDeploy
|
|
290
321
|
tmp +=<<-EOF
|
291
322
|
def #{k}=(v)
|
292
323
|
self.env_hash['#{k}'] = self.str_to_list(v)
|
324
|
+
DataCache.capfile = nil if '#{k}' == 'capfile_paths'
|
293
325
|
end
|
294
326
|
EOF
|
295
327
|
end
|
296
328
|
end
|
329
|
+
|
330
|
+
['app', 'db', 'web'].each do |k|
|
331
|
+
tmp +=<<-EOF
|
332
|
+
def #{k}
|
333
|
+
self.capfile.role_to_host_list :#{k}
|
334
|
+
end
|
335
|
+
EOF
|
336
|
+
end
|
297
337
|
|
298
338
|
class_eval tmp
|
339
|
+
|
340
|
+
# accessors for all defined env variables
|
341
|
+
def hosts
|
342
|
+
(self.web_hosts.to_a + self.db_hosts.to_a + self.balance_hosts.to_a + self.app_hosts.to_a).uniq.sort
|
343
|
+
end
|
344
|
+
|
345
|
+
def hosts=(list)
|
346
|
+
if (self.web_hosts.nil? && self.db_hosts.nil?) || self.web_hosts == self.db_hosts
|
347
|
+
self.web_hosts =
|
348
|
+
self.db_hosts =
|
349
|
+
self.balance_hosts =
|
350
|
+
self.app_hosts = self.str_to_list(list)
|
351
|
+
else
|
352
|
+
raise RuntimeError.new("Cannot assign value to 'hosts' if web_hosts &/or db_hosts already set.\n web_hosts: #{self.web_hosts}\n db_hosts: #{self.db_hosts}")
|
353
|
+
end
|
354
|
+
end
|
355
|
+
|
356
|
+
def migration_hosts
|
357
|
+
self.capfile.migration_host_list
|
358
|
+
end
|
299
359
|
end
|
300
360
|
end
|
@@ -11,7 +11,7 @@ end
|
|
11
11
|
<html lang="en">
|
12
12
|
<head>
|
13
13
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
14
|
-
<title>TddDeploy for <%= site %></title>
|
14
|
+
<title>TddDeploy (<%= TddDeploy::VERSION %>) for <%= site %></title>
|
15
15
|
<meta name="generator" content="TextMate http://macromates.com/">
|
16
16
|
<meta name="author" content="Mike">
|
17
17
|
<style type="text/css" media="screen">
|
@@ -74,7 +74,7 @@ end
|
|
74
74
|
</head>
|
75
75
|
<body>
|
76
76
|
<div id="test-summary">
|
77
|
-
<h1>
|
77
|
+
<h1>TddDeploy (<%= TddDeploy::VERSION %>) Test Results: site: <%= site %> / hosts: <%= hosts %></h1>
|
78
78
|
|
79
79
|
<% if (failures = total_failures) == 0 %>
|
80
80
|
<p id="test-summary-passed">All Tests Passed</p>
|
data/lib/tdd_deploy/version.rb
CHANGED
data/lib/tdd_deploy.rb
CHANGED
@@ -0,0 +1,51 @@
|
|
1
|
+
$:.unshift File.expand_path('..', __FILE__)
|
2
|
+
require 'test_helpers'
|
3
|
+
require 'tdd_deploy/capfile'
|
4
|
+
|
5
|
+
class TestCapfileTestCase < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@capfile = TddDeploy::Capfile.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
@capfile = nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_load_recipes
|
16
|
+
assert_raises LoadError, "@capfile.load_recipes(no-file) should fail" do
|
17
|
+
@capfile.load_recipes('no-file')
|
18
|
+
end
|
19
|
+
assert @capfile.load_recipes('./config/deploy.rb'), "@capfile should load recipies"
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_role_keys
|
23
|
+
@capfile.load_recipes('./config/deploy.rb')
|
24
|
+
assert_equal [:app, :db, :web], @capfile.roles.keys.sort, "capfile roles should be app, db, web"
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_role_values
|
28
|
+
@capfile.load_recipes # ('./config/deploy.rb')
|
29
|
+
assert_equal ['app1', 'app2', 'app3'], @capfile.roles[:app].servers.map {|x| x.to_s }.sort, "app servers should be app1, app2, app3"
|
30
|
+
assert_equal ['db2', 'db3', 'db_primary'], @capfile.roles[:db].servers.map {|x| x.to_s }.sort, "db servers should be db_primary, db2, db3"
|
31
|
+
assert_equal ['web1', 'web2'], @capfile.roles[:web].servers.map {|x| x.to_s }.sort, "web servers should be web1, web2"
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_role_to_host_list
|
35
|
+
@capfile.load_recipes('./config/deploy.rb')
|
36
|
+
assert_equal ['app1', 'app2', 'app3'], @capfile.role_to_host_list(:app).sort, "app servers should be app1, 2, 3"
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_migration_host_list
|
40
|
+
@capfile.load_recipes('./config/deploy.rb')
|
41
|
+
assert_equal ['db_primary'], @capfile.migration_host_list, "migration_host_list should be ['db_primary']"
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_simple_deploy_rb_file
|
45
|
+
@capfile.load_recipes('./config/simple_deploy.rb')
|
46
|
+
assert_equal ['app_server'], @capfile.role_to_host_list(:app), "app server should be ['app_server']"
|
47
|
+
assert_equal ['app_server'], @capfile.role_to_host_list(:db), "db server should be ['app_server']"
|
48
|
+
assert_equal ['app_server'], @capfile.role_to_host_list(:web), "web server should be ['app_server']"
|
49
|
+
assert_equal ['app_server'], @capfile.migration_host_list, "migration host server should be ['app_server']"
|
50
|
+
end
|
51
|
+
end
|
data/tests/test_environ.rb
CHANGED
@@ -40,7 +40,8 @@ class TestEnvironTestCase < Test::Unit::TestCase
|
|
40
40
|
@foo.clear_env
|
41
41
|
system('TMP=/tmp/t-$$; trap "rm $TMP; exit" 0 1 2 3 15 ;cp site_host_setup.env $TMP ; sed -e 1d $TMP >site_host_setup.env')
|
42
42
|
@foo.read_env
|
43
|
-
|
43
|
+
non_pseudo_keys = @foo.env_types.reject {|k,t| t == :pseudo }.keys.sort
|
44
|
+
assert_equal non_pseudo_keys, @foo.env_hash.keys.sort, "read_env should set all keys"
|
44
45
|
end
|
45
46
|
|
46
47
|
def test_response_to_accessors
|
@@ -61,7 +62,8 @@ class TestEnvironTestCase < Test::Unit::TestCase
|
|
61
62
|
[:env_hash, :ssh_timeout, :site_base_port, :site_num_servers,
|
62
63
|
:host_admin, :local_admin, :local_admin_email,
|
63
64
|
:site, :site_user, :site_path, :site_url,
|
64
|
-
:
|
65
|
+
:capfile_paths, :app, :db, :migration_hosts, :web,
|
66
|
+
:hosts, :app_hosts, :balance_hosts, :db_hosts, :web_hosts].each do |meth|
|
65
67
|
assert @foo.respond_to?(meth), "@foo should respond to #{meth}"
|
66
68
|
assert @foo.respond_to?("#{meth}".to_sym), "@foo should respond to #{meth}="
|
67
69
|
end
|
@@ -69,7 +71,7 @@ class TestEnvironTestCase < Test::Unit::TestCase
|
|
69
71
|
|
70
72
|
def test_env_type
|
71
73
|
["ssh_timeout", "site_base_port", "site_num_servers", "host_admin", "local_admin", "local_admin_email",
|
72
|
-
"site", "site_user", "site_path", "site_url", "balance_hosts", "db_hosts", "web_hosts"].each do |sym|
|
74
|
+
"site", "site_user", "site_path", "site_url", 'app_hosts', "balance_hosts", "db_hosts", "web_hosts"].each do |sym|
|
73
75
|
assert @foo.env_types.keys.include?(sym.to_s), "@foo.env_types.keys includes #{sym}"
|
74
76
|
end
|
75
77
|
["ssh_timeout", "site_base_port", "site_num_servers"].each do |key|
|
@@ -78,33 +80,34 @@ class TestEnvironTestCase < Test::Unit::TestCase
|
|
78
80
|
["host_admin", "local_admin", "local_admin_email", "site", "site_user", "site_path", "site_url"].each do |key|
|
79
81
|
assert_equal :string, @foo.env_types[key], "@foo.env_types[#{key}] should be :string"
|
80
82
|
end
|
81
|
-
["balance_hosts", "db_hosts", "web_hosts"].each do |key|
|
83
|
+
['app_hosts', "balance_hosts", "capfile_paths", "db_hosts", "web_hosts"].each do |key|
|
82
84
|
assert_equal :list, @foo.env_types[key], "@foo.env_types[#{key}] should be :list"
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
86
88
|
def test_hosts_pseudokey
|
87
|
-
@foo.set_env :web_hosts => '', :db_hosts => '', :balance_hosts => ''
|
89
|
+
@foo.set_env :web_hosts => '', :db_hosts => '', :app_hosts => '', :balance_hosts => ''
|
88
90
|
assert_equal [], @foo.web_hosts, "assigning '' to web_hosts should create empty list"
|
89
91
|
assert_equal [], @foo.db_hosts, "assigning '' to db_hosts should create empty list"
|
90
92
|
assert_equal [], @foo.balance_hosts, "assigning '' to balance_hosts should create empty list"
|
93
|
+
assert_equal [], @foo.app_hosts, "assigning '' to app_hosts should create empty list"
|
91
94
|
@foo.set_env :hosts => 'foo,bar'
|
92
95
|
assert_equal ['bar', 'foo'], @foo.hosts, "assigning foo,bar to hosts should create ['bar', 'foo']"
|
93
|
-
['web_hosts', 'db_hosts', 'balance_hosts'].each do |hst|
|
96
|
+
['app_hosts', 'web_hosts', 'db_hosts', 'balance_hosts'].each do |hst|
|
94
97
|
assert_equal @foo.send(hst.to_sym), @foo.hosts, "hosts should be same as @foo.#{hst}"
|
95
98
|
end
|
96
99
|
end
|
97
100
|
|
98
101
|
def test_env_hash
|
99
102
|
["ssh_timeout", "site_base_port", "site_num_servers", "host_admin", "local_admin", "local_admin_email",
|
100
|
-
"site", "site_user", "site_path", "site_url", "balance_hosts", "db_hosts", "web_hosts"].each do |key|
|
103
|
+
"site", "site_user", "site_path", "site_url", 'app_hosts', "balance_hosts", "db_hosts", "web_hosts"].each do |key|
|
101
104
|
assert_not_nil @foo.env_hash[key], "@foo.env_hash[#{key}] should not be nil"
|
102
105
|
end
|
103
106
|
end
|
104
107
|
|
105
108
|
def test_env_defaults
|
106
109
|
["ssh_timeout", "site_base_port", "site_num_servers", "host_admin", "local_admin", "local_admin_email",
|
107
|
-
"site", "site_user", "site_path", "site_url", "balance_hosts", "db_hosts", "web_hosts"].each do |key|
|
110
|
+
"site", "site_user", "site_path", "site_url", 'app_hosts', "balance_hosts", "db_hosts", "web_hosts"].each do |key|
|
108
111
|
assert_not_nil @foo.env_defaults[key], "@foo.env_defaults[#{key}] should not be nil"
|
109
112
|
end
|
110
113
|
end
|
@@ -124,18 +127,22 @@ class TestEnvironTestCase < Test::Unit::TestCase
|
|
124
127
|
@foo.send "#{key}=", tmp
|
125
128
|
assert_equal tmp, @foo.send(key.to_sym), "@foo.#{key} should now be #{tmp}"
|
126
129
|
end
|
127
|
-
["balance_hosts", "db_hosts", "web_hosts"].each do |key|
|
130
|
+
['app_hosts', "balance_hosts", "db_hosts", "web_hosts"].each do |key|
|
128
131
|
tmp = @foo.send(key.to_sym).join(',') + ',new,values'
|
129
132
|
@foo.send "#{key}=", tmp
|
130
133
|
assert_equal tmp.split(/,/), @foo.send(key.to_sym), "@foo.#{key} should now be #{tmp}"
|
131
134
|
end
|
132
135
|
end
|
133
136
|
|
137
|
+
def test_capfile_variables
|
138
|
+
assert_equal ['app1', 'app2', 'app3'], @foo.app, "@foo.app should return all the hosts in :app role"
|
139
|
+
end
|
140
|
+
|
134
141
|
def test_instance_level_reset_env
|
135
142
|
tmp = @foo.env_hash['ssh_timeout']
|
136
143
|
@foo.set_env 'ssh_timeout' => 12
|
137
144
|
assert_equal 12, @foo.env_hash['ssh_timeout'], "reset_env should change env_hash"
|
138
|
-
assert_equal 12, @foo.ssh_timeout, "reset_env change should show
|
145
|
+
assert_equal 12, @foo.ssh_timeout, "reset_env change should show in instance method"
|
139
146
|
end
|
140
147
|
|
141
148
|
def test_instance_env_hash_assign
|
@@ -153,6 +160,7 @@ class TestEnvironTestCase < Test::Unit::TestCase
|
|
153
160
|
when :int then expect = 0
|
154
161
|
when :string then expect = ''
|
155
162
|
when :list then expect = []
|
163
|
+
when :pseudo then next
|
156
164
|
end
|
157
165
|
assert_equal expect, @foo.env_hash[k], "After Zapping, env_hash['#{k}'] should be #{expect}"
|
158
166
|
assert_equal expect, @foo.send(k.to_sym), "After Zapping, @foo.#{k} should be #{expect}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdd_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-08-16 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
16
|
-
requirement: &
|
16
|
+
requirement: &2165394200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2165394200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: net-ping
|
27
|
-
requirement: &
|
27
|
+
requirement: &2165393520 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2165393520
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: net-ssh
|
38
|
-
requirement: &
|
38
|
+
requirement: &2165392800 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2165392800
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: ZenTest
|
49
|
-
requirement: &
|
49
|
+
requirement: &2165392020 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 4.5.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2165392020
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: autotest-growl
|
60
|
-
requirement: &
|
60
|
+
requirement: &2165391360 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2165391360
|
69
69
|
description: Test driven support for host provisioning & Capistrano deployment - for
|
70
70
|
those who don't want to bother learning too much
|
71
71
|
email: ! ' mike@clove.com '
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- bin/tdd_deploy_server
|
83
83
|
- lib/tdd_deploy/assertions.rb
|
84
84
|
- lib/tdd_deploy/base.rb
|
85
|
+
- lib/tdd_deploy/capfile.rb
|
85
86
|
- lib/tdd_deploy/configurator.rb
|
86
87
|
- lib/tdd_deploy/copy_methods.rb
|
87
88
|
- lib/tdd_deploy/deploy_test_methods.rb
|
@@ -103,6 +104,7 @@ files:
|
|
103
104
|
- lib/tdd_deploy.rb
|
104
105
|
- tests/test_assertions.rb
|
105
106
|
- tests/test_base.rb
|
107
|
+
- tests/test_capfile.rb
|
106
108
|
- tests/test_configurator.rb
|
107
109
|
- tests/test_copy_methods.rb
|
108
110
|
- tests/test_deploy_test_methods.rb
|