public
Description: Remote multi-server automation tool
Homepage: http://www.capify.org
Clone URL: git://github.com/jamis/capistrano.git
Improved test coverage for Capistrano::ServerDefinition.default_user
rmm5t (author)
Sat May 10 16:37:54 -0700 2008
commit  7b4cc3af720edeee1ce9bcbc1fc0d40396177e8f
tree    37974150cffd804df877d9f2dcd89509d57b7476
parent  3fe29b73dd966d1e99f7d1151b19bc8b793db476
...
62
63
64
 
 
 
 
 
 
 
 
 
 
 
 
 
65
66
67
...
105
106
107
108
109
 
...
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
...
118
119
120
 
121
122
0
@@ -62,6 +62,19 @@ class ServerDefinitionTest < Test::Unit::TestCase
0
     server = Capistrano::ServerDefinition.new("www.capistrano.test", :primary => true)
0
     assert_equal true, server.options[:primary]
0
   end
0
+
0
+ def test_default_user_should_try_to_guess_username
0
+ ENV.stubs(:[]).returns(nil)
0
+ assert_equal "not-specified", Capistrano::ServerDefinition.default_user
0
+
0
+ ENV.stubs(:[]).returns(nil)
0
+ ENV.stubs(:[]).with("USERNAME").returns("ryan")
0
+ assert_equal "ryan", Capistrano::ServerDefinition.default_user
0
+
0
+ ENV.stubs(:[]).returns(nil)
0
+ ENV.stubs(:[]).with("USER").returns("jamis")
0
+ assert_equal "jamis", Capistrano::ServerDefinition.default_user
0
+ end
0
 
0
   def test_comparison_should_match_when_host_user_port_are_same
0
     s1 = server("jamis@www.capistrano.test:8080")
0
@@ -105,4 +118,4 @@ class ServerDefinitionTest < Test::Unit::TestCase
0
     assert_equal "jamis@www.capistrano.test", server("jamis@www.capistrano.test").to_s
0
     assert_equal "jamis@www.capistrano.test:1234", server("jamis@www.capistrano.test:1234").to_s
0
   end
0
-end
0
\ No newline at end of file
0
+end

Comments

    No one has commented yet.