Created
May 11, 2009 23:41
-
-
Save foca/110242 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + "/../test_helper" | |
class ProjectTest < Integrity::TestCase | |
test "Doesn't save with the required attributes" do | |
assert Integrity.database | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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