Skip to content

Commit

Permalink
Create missing directories before testing.
Browse files Browse the repository at this point in the history
Create test/{db,log} before running the tests proper so SQLite and Logger can write their files.
  • Loading branch information
Manfred committed May 20, 2008
1 parent f914848 commit f8e2422
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
test/db
test/log
11 changes: 8 additions & 3 deletions test/helper.rb
Expand Up @@ -16,11 +16,16 @@
require 'sqlite3'
require 'mocha'
require 'bacon'
require 'fileutils'

ActiveRecord::Base.logger = Logger.new File.join(TEST_ROOT_DIR, '/log/test.log')
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :dbfile => File.join(TEST_ROOT_DIR, '/db/test.db'))
logdir = File.join(TEST_ROOT_DIR, 'log')
FileUtils.mkdir_p(logdir)
ActiveRecord::Base.logger = Logger.new File.join(logdir, 'test.log')
dbdir = File.join(TEST_ROOT_DIR, 'db')
FileUtils.mkdir_p(dbdir)
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :dbfile => File.join(dbdir, 'test.db'))

# Classes and methods to aid testing
require 'schema'
require 'attachments'
require 'upload_helpers'
require 'upload_helpers'

0 comments on commit f8e2422

Please sign in to comment.