Class: TddDeploy::Base

Inherits:
Object
  • Object
show all
Includes:
Assertions, CopyMethods, DeployTestMethods, Environ, RunMethods
Defined in:
lib/tdd_deploy/base.rb

Overview

TddDeploy::Base

TddDeploy::Base is a class which includes all the TddDeploy modules and initializes the environment.

it is meant to be subclassed for individual host and site tests.

class HostFacilityTest < TddDeploy::Base
   def test_for_file
     deploy_test_on_hosts_as user_id, match_string_or_regx, err_msg { command }
   end
   etc
 end

NOTE: Derived classes which provide an **initialize** method should call super
to ensure that the environment is set. See TddDeploy::Base to see what the
parent initializer does.

Direct Known Subclasses

Configurator, Installer, Server, TestBase

Constant Summary

Constants included from Assertions

Assertions::GROUP_ELT_TAG, Assertions::HEADER_ELT_TAG, Assertions::RESULT_ELT_TAG

Constants included from Environ

Environ::ENV_FNAME

Instance Method Summary collapse

Methods included from DeployTestMethods

#deploy_test_file_exists_on_hosts_as, #deploy_test_on_a_host_as, #deploy_test_on_hosts_as, #deploy_test_process_running_on_hosts_as

Methods included from RunMethods

#ping_host, #run_locally, #run_on_a_host_as, #run_on_all_hosts, #run_on_all_hosts_as, #run_on_hosts_as

Methods included from Assertions

#assert, #assert_equal, #assert_match, #assert_nil, #assert_not_nil, #assert_raises, #fail, #failure_count, #failure_messages, #formatted_test_results, #pass, #refute, #refute_equal, #refute_nil, #remove_failed_tests, #reset_tests, #test_count, #test_messages, #test_results, #total_failures, #total_tests

Methods included from CopyMethods

#append_dir_to_remote_hosts_as, #append_file_to_remote_file_as, #append_file_to_remote_hosts_as, #append_string_to_remote_file_as, #append_string_to_remote_file_on_hosts_as, #copy_dir_to_remote_hosts_as, #copy_file_to_remote_as, #copy_file_to_remote_hosts_as, #copy_string_to_remote_file_as, #copy_string_to_remote_file_on_hosts_as, #mkdir_on_remote_as

Methods included from Environ

#capfile, #clear_env, #env_defaults, #env_desc, #env_hash, #env_hash=, #env_types, #hosts, #hosts=, #list_to_str, #migration_hosts, #rationalize_host_list, #read_env, #reset_env, #save_env, #set_env, #str_to_list

Constructor Details

#initialize(*args) ⇒ Base

args are ignored, unless the args.last is a Hash. If it is passed to set_env. This allows derived classes to have their own arguments as well as allowing the environment values to modified in a uniform way.



35
36
37
38
# File 'lib/tdd_deploy/base.rb', line 35

def initialize *args
  self.env_hash || read_env || reset_env
  set_env(args.pop) if args.last.is_a? Hash
end