Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix tests to depend on a preset load path rather than an explicit req…

…uire path in each
  • Loading branch information...
commit b4bd52826ccfb5eb4392f1fc84c94cacba965036 1 parent cedcff2
@jamis jamis authored
Showing with 63 additions and 67 deletions.
  1. +2 −2 lib/capistrano/shell.rb
  2. +1 −1  test/cli/execute_test.rb
  3. +1 −1  test/cli/help_test.rb
  4. +1 −1  test/cli/options_test.rb
  5. +1 −1  test/cli/ui_test.rb
  6. +1 −1  test/cli_test.rb
  7. +1 −1  test/command_test.rb
  8. +1 −1  test/configuration/actions/file_transfer_test.rb
  9. +1 −1  test/configuration/actions/inspect_test.rb
  10. +1 −1  test/configuration/actions/invocation_test.rb
  11. +1 −1  test/configuration/callbacks_test.rb
  12. +1 −1  test/configuration/connections_test.rb
  13. +1 −1  test/configuration/execution_test.rb
  14. +1 −1  test/configuration/loading_test.rb
  15. +1 −1  test/configuration/namespace_dsl_test.rb
  16. +1 −1  test/configuration/roles_test.rb
  17. +1 −1  test/configuration/servers_test.rb
  18. +1 −1  test/configuration/variables_test.rb
  19. +1 −1  test/configuration_test.rb
  20. +1 −1  test/deploy/scm/accurev_test.rb
  21. +1 −1  test/deploy/scm/base_test.rb
  22. +1 −1  test/deploy/scm/git_test.rb
  23. +1 −1  test/deploy/scm/mercurial_test.rb
  24. +1 −1  test/deploy/strategy/copy_test.rb
  25. +1 −1  test/extensions_test.rb
  26. +1 −1  test/logger_test.rb
  27. +1 −1  test/server_definition_test.rb
  28. +1 −1  test/shell_test.rb
  29. +1 −1  test/ssh_test.rb
  30. +1 −1  test/task_definition_test.rb
  31. +1 −1  test/upload_test.rb
  32. +30 −34 test/utils.rb
  33. +1 −1  test/version_test.rb
View
4 lib/capistrano/shell.rb
@@ -1,5 +1,5 @@
require 'thread'
-require 'capistrano/command'
+require 'capistrano/processable'
module Capistrano
# The Capistrano::Shell class is the guts of the "shell" task. It implements
@@ -7,7 +7,7 @@ module Capistrano
# commands. It makes for a GREAT way to monitor systems, and perform quick
# maintenance on one or more machines.
class Shell
- include Command::Processable
+ include Processable
# A Readline replacement for platforms where readline is either
# unavailable, or has not been installed.
View
2  test/cli/execute_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/cli/execute'
class CLIExecuteTest < Test::Unit::TestCase
View
2  test/cli/help_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/cli/help'
class CLIHelpTest < Test::Unit::TestCase
View
2  test/cli/options_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/cli/options'
class CLIOptionsTest < Test::Unit::TestCase
View
2  test/cli/ui_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/cli/ui'
class CLIUITest < Test::Unit::TestCase
View
2  test/cli_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/cli'
class CLI_Test < Test::Unit::TestCase
View
2  test/command_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/command'
class CommandTest < Test::Unit::TestCase
View
2  test/configuration/actions/file_transfer_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/configuration/actions/file_transfer'
class ConfigurationActionsFileTransferTest < Test::Unit::TestCase
View
2  test/configuration/actions/inspect_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/configuration/actions/inspect'
class ConfigurationActionsInspectTest < Test::Unit::TestCase
View
2  test/configuration/actions/invocation_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/configuration/actions/invocation'
class ConfigurationActionsInvocationTest < Test::Unit::TestCase
View
2  test/configuration/callbacks_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/callbacks'
class ConfigurationCallbacksTest < Test::Unit::TestCase
View
2  test/configuration/connections_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/connections'
class ConfigurationConnectionsTest < Test::Unit::TestCase
View
2  test/configuration/execution_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/execution'
require 'capistrano/task_definition'
View
2  test/configuration/loading_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/loading'
class ConfigurationLoadingTest < Test::Unit::TestCase
View
2  test/configuration/namespace_dsl_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/namespaces'
class ConfigurationNamespacesDSLTest < Test::Unit::TestCase
View
2  test/configuration/roles_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/roles'
require 'capistrano/server_definition'
View
2  test/configuration/servers_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/task_definition'
require 'capistrano/configuration/servers'
View
2  test/configuration/variables_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/variables'
class ConfigurationVariablesTest < Test::Unit::TestCase
View
2  test/configuration_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/configuration'
# These tests are only for testing the integration of the various components
View
2  test/deploy/scm/accurev_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/recipes/deploy/scm/accurev'
class AccurevTest < Test::Unit::TestCase
View
2  test/deploy/scm/base_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/recipes/deploy/scm/base'
class DeploySCMBaseTest < Test::Unit::TestCase
View
2  test/deploy/scm/git_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/recipes/deploy/scm/git'
class DeploySCMGitTest < Test::Unit::TestCase
View
2  test/deploy/scm/mercurial_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/recipes/deploy/scm/mercurial'
class DeploySCMMercurialTest < Test::Unit::TestCase
View
2  test/deploy/strategy/copy_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/logger'
require 'capistrano/recipes/deploy/strategy/copy'
require 'stringio'
View
2  test/extensions_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano'
class ExtensionsTest < Test::Unit::TestCase
View
2  test/logger_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/logger'
require 'stringio'
View
2  test/server_definition_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/server_definition'
class ServerDefinitionTest < Test::Unit::TestCase
View
2  test/shell_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/configuration'
require 'capistrano/shell'
View
2  test/ssh_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/ssh'
class SSHTest < Test::Unit::TestCase
View
2  test/task_definition_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/task_definition'
class TaskDefinitionTest < Test::Unit::TestCase
View
2  test/upload_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/upload'
class UploadTest < Test::Unit::TestCase
View
64 test/utils.rb
@@ -1,42 +1,38 @@
-unless defined?(TestExtensions)
- $:.unshift "#{File.dirname(__FILE__)}/../lib"
-
- begin
- require 'rubygems'
- gem 'mocha'
- rescue LoadError
- end
-
- require 'test/unit'
- require 'mocha'
- require 'capistrano/server_definition'
+begin
+ require 'rubygems'
+ gem 'mocha'
+rescue LoadError
+end
- module TestExtensions
- def server(host, options={})
- Capistrano::ServerDefinition.new(host, options)
- end
+require 'test/unit'
+require 'mocha'
+require 'capistrano/server_definition'
- def namespace(fqn=nil)
- space = stub(:roles => {}, :fully_qualified_name => fqn, :default_task => nil)
- yield(space) if block_given?
- space
- end
+module TestExtensions
+ def server(host, options={})
+ Capistrano::ServerDefinition.new(host, options)
+ end
- def role(space, name, *args)
- opts = args.last.is_a?(Hash) ? args.pop : {}
- space.roles[name] ||= []
- space.roles[name].concat(args.map { |h| Capistrano::ServerDefinition.new(h, opts) })
- end
+ def namespace(fqn=nil)
+ space = stub(:roles => {}, :fully_qualified_name => fqn, :default_task => nil)
+ yield(space) if block_given?
+ space
+ end
- def new_task(name, namespace=@namespace, options={}, &block)
- block ||= Proc.new {}
- task = Capistrano::TaskDefinition.new(name, namespace, options, &block)
- assert_equal block, task.body
- return task
- end
+ def role(space, name, *args)
+ opts = args.last.is_a?(Hash) ? args.pop : {}
+ space.roles[name] ||= []
+ space.roles[name].concat(args.map { |h| Capistrano::ServerDefinition.new(h, opts) })
end
- class Test::Unit::TestCase
- include TestExtensions
+ def new_task(name, namespace=@namespace, options={}, &block)
+ block ||= Proc.new {}
+ task = Capistrano::TaskDefinition.new(name, namespace, options, &block)
+ assert_equal block, task.body
+ return task
end
end
+
+class Test::Unit::TestCase
+ include TestExtensions
+end
View
2  test/version_test.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/version'
class VersionTest < Test::Unit::TestCase
Please sign in to comment.
Something went wrong with that request. Please try again.