Skip to content

Commit

Permalink
get specs to run
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Sep 1, 2008
1 parent 5998931 commit e9499f5
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions spec/database.rb
@@ -1,13 +1,15 @@
$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'rubygems'
require 'active_record'
$:.unshift(File.dirname(__FILE__) + '/../../rspec/lib')

require 'rubygems'
require 'active_record'
require File.dirname(__FILE__) + '/../init'
require 'spec'

ActiveRecord::Base.logger = Logger.new(nil)
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => '/tmp/jobs.sqlite')
ActiveRecord::Migration.verbose = false

def reset_db
ActiveRecord::Schema.define do

Expand All @@ -16,20 +18,20 @@ def reset_db
table.integer :attempts, :default => 0
table.text :handler
table.string :last_error
table.datetime :run_at
table.datetime :locked_at
table.string :locked_by
table.timestamps
table.datetime :run_at
table.datetime :locked_at
table.string :locked_by
table.timestamps
end

create_table :stories, :force => true do |table|
table.string :text
end

end
end
end

# Purely useful for test cases...
class Story < ActiveRecord::Base
class Story < ActiveRecord::Base
def tell; text; end
end

0 comments on commit e9499f5

Please sign in to comment.