forked from webmat/git_remote_branch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_helper.rb
37 lines (30 loc) · 1007 Bytes
/
test_helper.rb
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
26
27
28
29
30
31
32
33
34
35
36
37
require 'rubygems'
require 'test/unit'
TEST_DIR = File.dirname(__FILE__)
# Install version 2 the shoulda gem with
# gem install thoughtbot-shoulda --source http://gems.github.com
# Shoulda depends on ActiveSupport 2.0, so if you don't have Rails 2.x installed, install ActiveSupport before Shoulda:
# gem install activesupport
gem 'thoughtbot-shoulda', '~> 2.0'
require 'shoulda'
gem 'mocha', '~> 0.5'
require 'mocha'
# Just load redgreen if not running tests from TextMate
IN_TM = !ENV['TM_DIRECTORY'].nil? unless defined?(IN_TM)
begin
require 'redgreen' unless IN_TM
require 'ruby-debug'
rescue LoadError => ex
puts "Couldn't load optional test dependencies: #{ex.inspect}"
end
require File.join( [TEST_DIR] + %w{ .. lib git_remote_branch} )
require "#{TEST_DIR}/helpers/in_dir"
Dir[TEST_DIR+'/helpers/**/*.rb'].each{|f| require f}
class Test::Unit::TestCase
include MoreAssertions
attr_reader :grb
def setup
@grb = Object.new
@grb.send :extend, GitRemoteBranch
end
end