Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improvements for running specs with activerecord

  • Loading branch information...
commit 22f2a02172ba2a444d23a728c4e223cb64e838b3 1 parent 05d6e03
@winton authored
View
4 .gitignore
@@ -3,6 +3,6 @@
*.gemspec
coverage
pkg
-spec/db/config/database.yml
-spec/db/log
+spec/config/database.yml
+spec/log
tmp
View
6 config/database.yml
@@ -1,6 +0,0 @@
-development:
- adapter: mysql
- database: gem_template
- username: root
- password:
- host: localhost
View
6 require.rb
@@ -31,8 +31,14 @@
end
spec_helper do
+ gem(:active_wrapper)
require 'require/spec_helper'
require 'lib/gem_template'
require 'pp'
end
+
+ spec_rakefile do
+ gem(:rake)
+ gem(:active_wrapper) { require 'active_wrapper/tasks' }
+ end
end
View
6 spec/Rakefile
@@ -1,9 +1,7 @@
-require 'rubygems'
-require 'rake'
+require File.expand_path("#{File.dirname(__FILE__)}/../require")
+Require.spec_rakefile!
begin
- require 'active_wrapper/tasks'
-
ActiveWrapper::Tasks.new(
:base => File.dirname(__FILE__),
:env => ENV['ENV']
View
13 spec/spec_helper.rb
@@ -2,9 +2,10 @@
Require.spec_helper!
Spec::Runner.configure do |config|
- $db, $log, $mail = ActiveWrapper.new(
- :base => File.dirname(__FILE__),
- :env => ENV['ENV']
- )
- $db.establish_connection
-end
+end
+
+$db, $log, $mail = ActiveWrapper.new(
+ :base => File.dirname(__FILE__),
+ :env => 'test'
+)
+$db.establish_connection
Please sign in to comment.
Something went wrong with that request. Please try again.