Browse files

broke a bunch of shit, but no longer need embedded rails app for testing

  • Loading branch information...
1 parent dc46e24 commit 460c2b37891145622988e8d38e944f0f377ce3a0 @janxious janxious committed Mar 3, 2012
Showing with 59 additions and 94 deletions.
  1. +1 −3 Gemfile
  2. +31 −70 Gemfile.lock
  3. +2 −1 Rakefile
  4. +7 −4 acts_as_archival.gemspec
  5. +0 −3 test/local_test_helper.rb
  6. +18 −13 test/test_helper.rb
View
4 Gemfile
@@ -1,4 +1,2 @@
-source :rubygems
-
-# Specify your gem's dependencies in acts_as_archival.gemspec
+source "https://rubygems.org"
gemspec
View
101 Gemfile.lock
@@ -2,86 +2,47 @@ PATH
remote: .
specs:
acts_as_archival (4.0.0)
- rails (= 3.0.12)
+ activerecord
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
- abstract (1.0.0)
- actionmailer (3.0.12)
- actionpack (= 3.0.12)
- mail (~> 2.2.19)
- actionpack (3.0.12)
- activemodel (= 3.0.12)
- activesupport (= 3.0.12)
- builder (~> 2.1.2)
- erubis (~> 2.6.6)
- i18n (~> 0.5.0)
- rack (~> 1.2.5)
- rack-mount (~> 0.6.14)
- rack-test (~> 0.5.7)
- tzinfo (~> 0.3.23)
- activemodel (3.0.12)
- activesupport (= 3.0.12)
- builder (~> 2.1.2)
- i18n (~> 0.5.0)
- activerecord (3.0.12)
- activemodel (= 3.0.12)
- activesupport (= 3.0.12)
- arel (~> 2.0.10)
- tzinfo (~> 0.3.23)
- activeresource (3.0.12)
- activemodel (= 3.0.12)
- activesupport (= 3.0.12)
- activesupport (3.0.12)
- arel (2.0.10)
+ activemodel (3.2.2)
+ activesupport (= 3.2.2)
+ builder (~> 3.0.0)
+ activerecord (3.2.2)
+ activemodel (= 3.2.2)
+ activesupport (= 3.2.2)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activesupport (3.2.2)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
assertions-eb (1.7.3)
- builder (2.1.2)
- erubis (2.6.6)
- abstract (>= 1.0.0)
- i18n (0.5.0)
- json (1.6.5)
- mail (2.2.19)
- activesupport (>= 2.3.6)
- i18n (>= 0.4.0)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.17.2)
- mysql2 (0.2.18)
- polyglot (0.3.3)
- rack (1.2.5)
- rack-mount (0.6.14)
- rack (>= 1.0.0)
- rack-test (0.5.7)
- rack (>= 1.0)
- rails (3.0.12)
- actionmailer (= 3.0.12)
- actionpack (= 3.0.12)
- activerecord (= 3.0.12)
- activeresource (= 3.0.12)
- activesupport (= 3.0.12)
- bundler (~> 1.0)
- railties (= 3.0.12)
- railties (3.0.12)
- actionpack (= 3.0.12)
- activesupport (= 3.0.12)
- rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (~> 0.14.4)
+ builder (3.0.0)
+ coderay (1.0.5)
+ highline (1.6.11)
+ i18n (0.6.0)
+ method_source (0.7.1)
+ multi_json (1.1.0)
+ mysql2 (0.3.11)
+ pry (0.9.8.3)
+ coderay (~> 1.0.5)
+ method_source (~> 0.7.1)
+ slop (>= 2.4.4, < 3)
rake (0.9.2.2)
- rdoc (3.12)
- json (~> 1.4)
- thor (0.14.6)
- treetop (1.4.10)
- polyglot
- polyglot (>= 0.3.1)
+ slop (2.4.4)
tzinfo (0.3.31)
PLATFORMS
ruby
DEPENDENCIES
+ activesupport
acts_as_archival!
assertions-eb
- mysql2 (= 0.2.18)
- rake (= 0.9.2.2)
+ highline
+ mysql2
+ pry
+ rake
View
3 Rakefile
@@ -1,3 +1,4 @@
+#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rake/testtask"
@@ -7,6 +8,6 @@ task :default => :test
desc "Test the acts_as_archival plugin."
Rake::TestTask.new(:test) do |t|
t.libs << "test"
- t.pattern = "test/*_test.rb"
+ t.pattern = "test/**/*_test.rb"
t.verbose = true
end
View
11 acts_as_archival.gemspec
@@ -19,13 +19,16 @@ Gem::Specification.new do |gem|
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.require_paths = ["lib"]
- gem.add_dependency "rails", "3.0.12"
+ gem.add_dependency "activerecord"
+
+ gem.add_development_dependency "activesupport"
gem.add_development_dependency "assertions-eb"
- gem.add_development_dependency "mysql2", "0.2.18"
- gem.add_development_dependency "rake", "0.9.2.2"
+ gem.add_development_dependency "rake"
+ gem.add_development_dependency "mysql2"
+ gem.add_development_dependency "highline"
+ gem.add_development_dependency "pry"
gem.description = %q{We had the problem that acts_as_paranoid and similar plugins/gems always work on a record by record basis and made it very difficult to restore records atomically (or archive them, for that matter).
View
3 test/local_test_helper.rb
@@ -1,3 +0,0 @@
-ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
-
-load(File.dirname(__FILE__) + "/schema.rb") if File.exist?(File.dirname(__FILE__) + "/schema.rb")
View
31 test/test_helper.rb
@@ -1,23 +1,28 @@
$:.unshift(File.dirname(__FILE__) + '/../lib')
+require "bundler/setup"
+require "test/unit"
require "active_record"
+require "assertions"
+require "logger"
+require "pry"
+
require "acts_as_archival"
-ENV["RAILS_ENV"] = "test"
-["aaa_test_app/config/environment", "local_test_helper"].each do |file_to_load|
- require_relative file_to_load
-end
+database_config = File.dirname(__FILE__) + "/database.yml"
+logfile = File.dirname(__FILE__) + "/debug.log"
+schema_file = File.dirname(__FILE__) + "/schema.rb"
+
+dbconfig = YAML.load File.read(database_config)
-require 'rails/test_help'
-require 'assertions'
+ActiveRecord::Base.logger = Logger.new(logfile)
+ActiveRecord::Base.establish_connection(dbconfig)
+load(schema_file) if File.exist?(schema_file)
-%w(hole mole muskrat squirrel kitty puppy ship rat orange flea snake beaver tick ixodidae).each do |a|
- require File.expand_path(File.dirname(__FILE__) + "/" + a)
+%w(hole mole muskrat squirrel kitty puppy ship rat orange flea snake beaver tick ixodidae).each do |test_class_file|
+ require_relative test_class_file
end
class ActiveSupport::TestCase
- self.use_transactional_fixtures = true
-
- self.use_instantiated_fixtures = false
-
- fixtures :all
+ use_transactional_fixtures = true
+ use_instantiated_fixtures = false
end

0 comments on commit 460c2b3

Please sign in to comment.