public
Description: Remote multi-server automation tool
Homepage: http://www.capify.org
Clone URL: git://github.com/jamis/capistrano.git
add some more tests to bring code coverage up


git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@6319 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
jamis (author)
Sun Mar 04 13:09:37 -0800 2007
commit  b8a1698d3904695ee15adf38d5838a88df1c88a9
tree    aad8ca3dc9091388e1bdd1f01d7323362fcde6d2
parent  f74ab735ed2f45ab229d43a2a4f43a577a765b03
...
57
58
59
 
 
60
61
...
57
58
59
60
61
62
63
0
@@ -57,4 +57,6 @@ end
0
 desc "Clean up generated directories and files"
0
 task :clean do
0
   rm_rf "pkg"
0
+ rm_rf "doc"
0
+ rm_rf "coverage"
0
 end
0
\ No newline at end of file
...
1
2
3
4
5
6
...
1
2
 
3
4
5
0
@@ -1,6 +1,5 @@
0
 #require 'capistrano/extensions'
0
 require 'capistrano/logger'
0
-require 'capistrano/utils'
0
 
0
 require 'capistrano/configuration/connections'
0
 require 'capistrano/configuration/execution'
...
183
184
185
 
 
 
 
 
 
186
187
...
183
184
185
186
187
188
189
190
191
192
193
0
@@ -183,4 +183,10 @@ class CLIOptionsTest < Test::Unit::TestCase
0
     @cli.parse_options!
0
     assert_equal %w(capfile), @cli.options[:recipes]
0
   end
0
+
0
+ def test_parse_should_instantiate_new_cli_and_call_parse_options
0
+ cli = mock("cli", :parse_options! => nil)
0
+ MockCLI.expects(:new).with(%w(a b c)).returns(cli)
0
+ assert_equal cli, MockCLI.parse(%w(a b c))
0
+ end
0
 end
0
\ No newline at end of file
...
206
207
208
 
 
 
 
 
 
 
 
209
210
211
...
206
207
208
209
210
211
212
213
214
215
216
217
218
219
0
@@ -206,6 +206,14 @@ class CommandTest < Test::Unit::TestCase
0
     assert_nothing_raised { cmd.process! }
0
   end
0
 
0
+ def test_process_should_instantiate_command_and_process!
0
+ cmd = mock("command", :process! => nil)
0
+ Capistrano::Command.expects(:new).with("ls -l", %w(a b c), {:foo => "bar"}).yields(:command).returns(cmd)
0
+ parameter = nil
0
+ Capistrano::Command.process("ls -l", %w(a b c), :foo => "bar") { |cmd| parameter = cmd }
0
+ assert_equal :command, parameter
0
+ end
0
+
0
   private
0
 
0
     def new_channel(closed, status=nil)
...
233
234
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
237
...
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
0
@@ -233,4 +233,22 @@ class ConfigurationNamespacesDSLTest < Test::Unit::TestCase
0
 
0
     assert_equal %w(first outer:inner:third outer:second), @config.task_list(:all).map { |t| t.fully_qualified_name }.sort
0
   end
0
+
0
+ def test_namespace_should_respond_to_its_parents_methods
0
+ @config.namespace(:outer) {}
0
+ ns = @config.namespaces[:outer]
0
+ assert ns.respond_to?(:original_initialize_called)
0
+ end
0
+
0
+ def test_namespace_should_delegate_unknown_messages_to_its_parent
0
+ @config.namespace(:outer) {}
0
+ ns = @config.namespaces[:outer]
0
+ assert ns.original_initialize_called
0
+ end
0
+
0
+ def test_namespace_should_not_understand_messages_that_neither_it_nor_its_parent_understands
0
+ @config.namespace(:outer) {}
0
+ ns = @config.namespaces[:outer]
0
+ assert_raises(NoMethodError) { ns.alskdfjlsf }
0
+ end
0
 end
0
\ No newline at end of file
...
1
2
3
 
 
 
 
4
5
6
...
1
2
3
4
5
6
7
8
9
10
0
@@ -1,6 +1,10 @@
0
 require "#{File.dirname(__FILE__)}/utils"
0
 require 'capistrano/configuration'
0
 
0
+# These tests are only for testing the integration of the various components
0
+# of the Configuration class. To test specific features, please look at the
0
+# tests under test/configuration.
0
+
0
 class ConfigurationTest < Test::Unit::TestCase
0
   def setup
0
     @config = Capistrano::Configuration.new

Comments

    No one has commented yet.