Permalink
Browse files

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

…uire path in each
  • Loading branch information...
jamis committed Apr 25, 2008
1 parent cedcff2 commit b4bd52826ccfb5eb4392f1fc84c94cacba965036
View
@@ -1,13 +1,13 @@
require 'thread'
-require 'capistrano/command'
+require 'capistrano/processable'
module Capistrano
# The Capistrano::Shell class is the guts of the "shell" task. It implements
# an interactive REPL interface that users can employ to execute tasks and
# 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
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/cli/execute'
class CLIExecuteTest < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/cli/help'
class CLIHelpTest < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/cli/options'
class CLIOptionsTest < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/cli/ui'
class CLIUITest < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/cli'
class CLI_Test < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/command'
class CommandTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/configuration/actions/file_transfer'
class ConfigurationActionsFileTransferTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/configuration/actions/inspect'
class ConfigurationActionsInspectTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/configuration/actions/invocation'
class ConfigurationActionsInvocationTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/callbacks'
class ConfigurationCallbacksTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/connections'
class ConfigurationConnectionsTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/execution'
require 'capistrano/task_definition'
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/loading'
class ConfigurationLoadingTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/namespaces'
class ConfigurationNamespacesDSLTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/roles'
require 'capistrano/server_definition'
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/task_definition'
require 'capistrano/configuration/servers'
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../utils"
+require "utils"
require 'capistrano/configuration/variables'
class ConfigurationVariablesTest < Test::Unit::TestCase
@@ -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
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/recipes/deploy/scm/accurev'
class AccurevTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/recipes/deploy/scm/base'
class DeploySCMBaseTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/recipes/deploy/scm/git'
class DeploySCMGitTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/recipes/deploy/scm/mercurial'
class DeploySCMMercurialTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../utils"
+require "utils"
require 'capistrano/logger'
require 'capistrano/recipes/deploy/strategy/copy'
require 'stringio'
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano'
class ExtensionsTest < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/logger'
require 'stringio'
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/server_definition'
class ServerDefinitionTest < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/configuration'
require 'capistrano/shell'
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/ssh'
class SSHTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/task_definition'
class TaskDefinitionTest < Test::Unit::TestCase
View
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/upload'
class UploadTest < Test::Unit::TestCase
View
@@ -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
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/utils"
+require "utils"
require 'capistrano/version'
class VersionTest < Test::Unit::TestCase

0 comments on commit b4bd528

Please sign in to comment.