public
Description: Ruby replacement for bash+ssh
Homepage: http://rush.heroku.com/
Clone URL: git://github.com/adamwiggins/rush.git
rush / spec / base.rb
100644 25 lines (19 sloc) 0.42 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'rubygems'
require 'spec'
 
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
require 'rush'
 
def mock_config(&block)
mock_config_start
block.call(config)
mock_config_end
end
 
def mock_config_sandbox_dir
"/tmp/fake_config.#{Process.pid}"
end
 
def mock_config_start
mock_config_cleanup
Rush::Config.new(mock_config_sandbox_dir)
end
 
def mock_config_cleanup
FileUtils.rm_rf(mock_config_sandbox_dir)
end