Browse files

[gem_template/spec-activerecord] First commit

  • Loading branch information...
1 parent 4ab38af commit ffe82f2522000b17fa09c8be188a7c2b5721b12e @winton committed Nov 6, 2009
Showing with 31 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +1 −0 gemspec.rb
  3. +12 −0 spec/Rakefile
  4. +6 −0 spec/config/database.yml.example
  5. +10 −0 spec/spec_helper.rb
View
2 .gitignore
@@ -2,4 +2,6 @@
*.gem
coverage
pkg
+spec/db/config/database.yml
+spec/db/log
tmp
View
1 gemspec.rb
@@ -7,6 +7,7 @@
s.homepage = "http://github.com/winton/#{GEM_NAME}"
s.summary = ""
# == CONFIGURE ==
+ s.add_dependency('winton-active_wrapper', '>=0.1.2')
s.executables << GEM_NAME
s.extensions << "install"
s.extra_rdoc_files = [ "README.markdown" ]
View
12 spec/Rakefile
@@ -0,0 +1,12 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'active_wrapper/tasks'
+
+ ActiveWrapper::Tasks.new(
+ :base => File.dirname(__FILE__),
+ :env => ENV['ENV']
+ )
+rescue Exception
+end
View
6 spec/config/database.yml.example
@@ -0,0 +1,6 @@
+test:
+ adapter: mysql
+ database: gem_template
+ username: root
+ password:
+ host: localhost
View
10 spec/spec_helper.rb
@@ -1,11 +1,21 @@
$TESTING=true
SPEC = File.dirname(__FILE__)
+
+$:.unshift SPEC
$:.unshift File.expand_path("#{SPEC}/../lib")
require 'gem_template'
require 'pp'
+require 'rubygems'
+require 'active_wrapper'
+
Spec::Runner.configure do |config|
+ $db, $log, $mail = ActiveWrapper.new(
+ :base => File.dirname(__FILE__),
+ :env => ENV['ENV']
+ )
+ $db.establish_connection
end
# For use with rspec textmate bundle

0 comments on commit ffe82f2

Please sign in to comment.