Skip to content

Instantly share code, notes, and snippets.

@foca
Created May 11, 2009 23:41
Show Gist options
  • Save foca/110242 to your computer and use it in GitHub Desktop.
Save foca/110242 to your computer and use it in GitHub Desktop.
require File.dirname(__FILE__) + "/../test_helper"
class ProjectTest < Integrity::TestCase
test "Doesn't save with the required attributes" do
assert Integrity.database
end
end
def __ROOT__
File.expand_path(File.dirname(__FILE__) + "/../")
end
require "test/unit"
require "contest"
require "matchy"
require "rr"
begin
require "redgreen"
rescue LoadError
end
if ENV["DEBUG"]
require "ruby-debug"
else
def debugger
puts "Run your tests with DEBUG=1 to use the debugger"
end
end
require "#{__ROOT__}/lib/integrity"
class Integrity::TestCase < Test::Unit::TestCase
include RR::Adapters::TestUnit
include Integrity
def reset_database
Integrity.connect_to_database
Sequel::Migrator.apply(Integrity.database, "#{__ROOT__}/lib/integrity/migrations")
end
def reset_config
Integrity.configure do |config|
config.database_uri = "sqlite::memory:"
config.log_file = "/dev/null"
config.build_path = "#{__ROOT__}/tmp"
end
end
setup do
puts 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment