Skip to content

Commit

Permalink
Require rubygems in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sr committed Apr 6, 2009
1 parent 6e60639 commit ade7c10
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
48 changes: 21 additions & 27 deletions test/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
$:.unshift File.dirname(__FILE__) + "/../lib", File.dirname(__FILE__)

%w(test/unit
context
pending
matchy
storyteller
webrat/sinatra
rr
mocha
dm-sweatshop).each { |dependency|
begin
require dependency
rescue LoadError => e
puts "You're missing some gems required to run the tests."
puts "Please run `rake test:setup`"
puts "NOTE: You'll probably need to run that command as root or with sudo."

puts "Thanks :)"
puts

raise
end
}
require "rubygems"

require "test/unit"
require "rr"
require "mocha"
require "dm-sweatshop"
require "webrat/sinatra"

gem "jeremymcanally-context"
gem "jeremymcanally-matchy"
gem "jeremymcanally-pending"
require "context"
require "matchy"
require "pending"

require "integrity"
require "integrity/notifier/test/fixtures"

require "helpers/expectations"

begin
require "ruby-debug"
require "redgreen"
rescue LoadError
end

require "integrity"
require "helpers/expectations"
require "integrity/notifier/test/fixtures"

module TestHelper
def ignore_logs!
Integrity.config[:log] = "/tmp/integrity.test.log"
Expand Down Expand Up @@ -65,10 +58,11 @@ class << self

before(:all) do
DataMapper.setup(:default, "sqlite3::memory:")

require "integrity/migrations"
end

before(:each) do
require "integrity/migrations"
[Project, Build, Commit, Notifier].each(&:auto_migrate_down!)
capture_stdout { Integrity.migrate_db }

Expand Down
4 changes: 4 additions & 0 deletions test/helpers/acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
require File.dirname(__FILE__) + "/../helpers"

gem "foca-storyteller"
require "storyteller"

require "helpers/acceptance/git_helper"

module AcceptanceHelper
Expand Down

0 comments on commit ade7c10

Please sign in to comment.