2010-02-06 07:41:22 +00:00
|
|
|
begin
|
|
|
|
require File.expand_path('../.bundle/environment', __FILE__)
|
2010-01-22 05:07:01 +00:00
|
|
|
rescue LoadError
|
2010-02-06 07:41:22 +00:00
|
|
|
# Fallback on doing the resolve at runtime.
|
|
|
|
require "rubygems"
|
|
|
|
require "bundler"
|
|
|
|
Bundler.setup
|
2010-01-22 05:07:01 +00:00
|
|
|
end
|
|
|
|
|
2010-01-30 04:40:43 +00:00
|
|
|
# This silences logger output
|
2010-01-30 04:38:36 +00:00
|
|
|
ENV['HOBO_ENV'] = 'test'
|
|
|
|
|
2010-01-22 05:36:34 +00:00
|
|
|
# ruby-debug, not necessary, but useful if we have it
|
|
|
|
begin
|
|
|
|
require 'ruby-debug'
|
|
|
|
rescue LoadError; end
|
|
|
|
|
2010-01-30 07:22:03 +00:00
|
|
|
|
2010-01-22 05:54:23 +00:00
|
|
|
require File.join(File.dirname(__FILE__), '..', 'lib', 'hobo')
|
|
|
|
require 'contest'
|
2010-01-22 07:57:31 +00:00
|
|
|
require 'mocha'
|
2010-01-26 08:01:17 +00:00
|
|
|
|
2010-01-30 04:38:36 +00:00
|
|
|
class Test::Unit::TestCase
|
|
|
|
def hobo_mock_config
|
2010-02-02 06:14:40 +00:00
|
|
|
Hobo::Config.instance_variable_set(:@config_runners, nil)
|
|
|
|
Hobo::Config.instance_variable_set(:@config, nil)
|
|
|
|
|
|
|
|
Hobo::Config.run do |config|
|
|
|
|
config.dotfile_name = ".hobo"
|
|
|
|
|
2010-02-03 08:17:32 +00:00
|
|
|
config.ssh.username = "foo"
|
|
|
|
config.ssh.password = "bar"
|
2010-02-02 06:14:40 +00:00
|
|
|
config.ssh.host = "baz"
|
2010-02-03 08:02:12 +00:00
|
|
|
config.ssh.forwarded_port_key = "ssh"
|
2010-02-02 06:14:40 +00:00
|
|
|
config.ssh.max_tries = 10
|
|
|
|
|
|
|
|
config.vm.base = "foo"
|
|
|
|
config.vm.base_mac = "42"
|
2010-02-03 08:02:12 +00:00
|
|
|
config.vm.forward_port("ssh", 22, 2222)
|
2010-02-02 06:14:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Hobo::Config.execute!
|
2010-01-30 04:38:36 +00:00
|
|
|
end
|
2010-01-30 07:22:03 +00:00
|
|
|
end
|