Skip to content

Commit

Permalink
added database settings for fixture.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Sep 24, 2012
1 parent 16199c9 commit 194d32e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/acceptance_helper.rb
Expand Up @@ -34,10 +34,21 @@
config.before(:each) do
FileUtils.mkdir_p work_data_dir
FileUtils.cp_r fixture_conf, File.join(work_data_dir, "tdiary.conf"), :verbose => false unless fixture_conf.empty?
Sequel.connect('sqlite://tmp/tdiary_test.db') do |db|
db.create_table :conf do
String :body, :text => true
end
db[:conf].insert(:body => File.read(fixture_conf))
end
end

config.after(:each) do
FileUtils.rm_r work_data_dir
Sequel.connect('sqlite://tmp/tdiary_test.db') do |db|
[:diaries, :comments, :conf].each do |table|
db.drop_table(table) if db.table_exists? table
end
end
end

config.after(:all) do
Expand Down
13 changes: 13 additions & 0 deletions spec/fixtures/tdiary.conf.rack
@@ -1,12 +1,25 @@
# -*- coding: utf-8 -*-

@data_path = File.expand_path("tmp/data", File.dirname(__FILE__))
@database_url = 'sqlite://tmp/tdiary_test.db'

require 'tdiary/io/cache/file'
require 'tdiary/io/rdb'
@io_class = TDiary::RdbIO

@style = 'Wiki'

@index = './'
@update = 'update.rb'

@options['apply_plugin'] = true
@options['sp.path'] = [
'misc/plugin'
]
@options['style.path'] = [
'misc/style/gfm',
'tdiary/style'
]

@accesskey_enabled = false
@options['bot'] = [
Expand Down

0 comments on commit 194d32e

Please sign in to comment.