spec/spec_helper.rb in rmce_uploadr-0.0.2 vs spec/spec_helper.rb in rmce_uploadr-0.0.3
- old
+ new
@@ -13,22 +13,27 @@
require 'spec'
require 'spec/autorun'
module RMceUploadr; module Test; module Controllers
def app
- @app ||= ::RMCEUploadr::App
+ @app ||= ::RMceUploadr::App
end
end; end; end
Spec::Runner.configure do |config|
Rake.application = Rake::Application.new
- # load File.join(File.dirname(__FILE__), '..', 'Rakefile')
+
+ # before all tests begin
config.before(:all) do
- # before :all tests config
+ test_db = File.join(File.dirname(__FILE__), 'dummy.sqlite3')
+ FileUtils.cp File.join(File.dirname(__FILE__), 'test.sqlite3'), test_db
+
+ ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => test_db)
end
+ # after :all tests end
config.after(:all) do
- # after :all tests config
+ FileUtils.rm File.join(File.dirname(__FILE__), 'dummy.sqlite3')
end
config.include(Rack::Test::Methods, RMceUploadr::Test::Controllers, :type => :controller)
end