Permalink
Browse files

refresh build system powered by bundler

  • Loading branch information...
mislav committed Jul 28, 2011
1 parent f169dcc commit 11a97db77595303d6fa44be6db4297e75dd5fcf2
View
@@ -2,3 +2,4 @@
/rails
*.gem
/coverage
+.bundle
View
@@ -0,0 +1,13 @@
+rvm:
+ - 1.8.6
+ - 1.8.7
+gemfile:
+ - Gemfile
+ - test/gemfiles/Gemfile.2.2
+ - test/gemfiles/Gemfile.2.1
+ - test/gemfiles/Gemfile.2.0
+ - test/gemfiles/Gemfile.1.2
+env:
+ - DB=sqlite3
+ - DB=mysql
+ - DB=postgres
View
12 Gemfile
@@ -0,0 +1,12 @@
+source 'http://rubygems.org'
+
+rails_version = '~> 2.3.6'
+
+gem 'actionpack', rails_version
+gem 'activerecord', rails_version
+
+gem 'rake', '~> 0.8.7'
+gem 'mocha'
+gem 'sqlite3'
+gem 'mysql', :group => :mysql
+gem 'pg', :group => :pg
View
@@ -0,0 +1,27 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionpack (2.3.12)
+ activesupport (= 2.3.12)
+ rack (~> 1.1.0)
+ activerecord (2.3.12)
+ activesupport (= 2.3.12)
+ activesupport (2.3.12)
+ mocha (0.9.12)
+ mysql (2.8.1)
+ pg (0.11.0)
+ rack (1.1.2)
+ rake (0.8.7)
+ sqlite3 (1.3.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ actionpack (~> 2.3.6)
+ activerecord (~> 2.3.6)
+ mocha
+ mysql
+ pg
+ rake (~> 0.8.7)
+ sqlite3
View
@@ -1,31 +1,38 @@
-require 'rubygems'
-begin
- hanna_dir = '/Users/mislav/Projects/Hanna/lib'
- $:.unshift hanna_dir if File.exists? hanna_dir
- require 'hanna/rdoctask'
-rescue LoadError
- require 'rake'
- require 'rake/rdoctask'
-end
-load 'test/tasks.rake'
+require 'rake/testtask'
desc 'Default: run unit tests.'
-task :default => :test
+task :default => [:create_database, :test]
-desc 'Generate RDoc documentation for the will_paginate plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'CHANGELOG.rdoc').
- include('lib/**/*.rb').
- exclude('lib/will_paginate/named_scope*').
- exclude('lib/will_paginate/array.rb').
- exclude('lib/will_paginate/version.rb')
-
- rdoc.main = "README.rdoc" # page to start on
- rdoc.title = "will_paginate documentation"
-
- rdoc.rdoc_dir = 'doc' # rdoc output folder
- rdoc.options << '--inline-source' << '--charset=UTF-8'
- rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/'
+desc 'Test the will_paginate plugin.'
+Rake::TestTask.new(:test) do |t|
+ t.pattern = 'test/**/*_test.rb'
+ t.libs << 'test'
+end
+
+namespace :test do ||
+ desc 'Test only Rails integration'
+ Rake::TestTask.new(:rails) do |t|
+ t.pattern = %w[test/finder_test.rb test/view_test.rb]
+ t.libs << 'test'
+ end
+
+ desc 'Test only ActiveRecord integration'
+ Rake::TestTask.new(:db) do |t|
+ t.pattern = %w[test/finder_test.rb]
+ t.libs << 'test'
+ end
+end
+
+desc 'Create necessary databases'
+task :create_database do |variable|
+ case ENV['DB']
+ when 'mysql', 'mysql2'
+ `mysql -e 'create database will_paginate;'`
+ abort "failed to create mysql database" unless $?.success?
+ when 'postgres'
+ `psql -c 'create database will_paginate;' -U postgres`
+ abort "failed to create postgres database" unless $?.success?
+ end
end
desc %{Update ".manifest" with the latest list of project filenames. Respect\
View
@@ -1,21 +0,0 @@
-plugin_root = File.join(File.dirname(__FILE__), '..')
-version = ENV['RAILS_VERSION']
-version = nil if version and version == ""
-
-# first look for a symlink to a copy of the framework
-if !version and framework_root = ["#{plugin_root}/rails", "#{plugin_root}/../../rails"].find { |p| File.directory? p }
- puts "found framework root: #{framework_root}"
- # this allows for a plugin to be tested outside of an app and without Rails gems
- $:.unshift "#{framework_root}/activesupport/lib", "#{framework_root}/activerecord/lib", "#{framework_root}/actionpack/lib"
-else
- # simply use installed gems if available
- puts "using Rails#{version ? ' ' + version : nil} gems"
- require 'rubygems'
-
- if version
- gem 'rails', version
- else
- gem 'actionpack', '< 3.0.0.a'
- gem 'activerecord', '< 3.0.0.a'
- end
-end
View
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
-libs = []
-libs << 'irb/completion'
-libs << File.join('lib', 'load_fixtures')
+opts = %w[ --simple-prompt ]
+opts << '-rirb/completion'
+opts << '-rlib/load_fixtures'
-exec "#{irb} -Ilib:test#{libs.map{ |l| " -r #{l}" }.join} --simple-prompt"
+exec irb, '-Ilib:test', *opts
View
@@ -3,20 +3,14 @@ sqlite3:
adapter: sqlite3
timeout: 500
-sqlite2:
- database: ":memory:"
- adapter: sqlite2
-
mysql:
adapter: mysql
- username: root
- password:
+ database: will_paginate
+ username:
encoding: utf8
- database: will_paginate_unittest
postgres:
adapter: postgresql
- username: mislav
- password:
- database: will_paginate_unittest
+ database: will_paginate
+ username: postgres
min_messages: warning
@@ -0,0 +1,9 @@
+source 'http://rubygems.org'
+
+gem 'rails', '~> 1.2.6'
+
+gem 'rake', '~> 0.8.7'
+gem 'mocha'
+gem 'sqlite3'
+gem 'mysql', :group => :mysql
+gem 'pg', :group => :pg
@@ -0,0 +1,36 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (1.3.6)
+ actionpack (= 1.13.6)
+ actionpack (1.13.6)
+ activesupport (= 1.4.4)
+ actionwebservice (1.2.6)
+ actionpack (= 1.13.6)
+ activerecord (= 1.15.6)
+ activerecord (1.15.6)
+ activesupport (= 1.4.4)
+ activesupport (1.4.4)
+ mocha (0.9.12)
+ mysql (2.8.1)
+ pg (0.11.0)
+ rails (1.2.6)
+ actionmailer (= 1.3.6)
+ actionpack (= 1.13.6)
+ actionwebservice (= 1.2.6)
+ activerecord (= 1.15.6)
+ activesupport (= 1.4.4)
+ rake (>= 0.7.2)
+ rake (0.8.7)
+ sqlite3 (1.3.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ mocha
+ mysql
+ pg
+ rails (~> 1.2.6)
+ rake (~> 0.8.7)
+ sqlite3
View
@@ -0,0 +1,12 @@
+source 'http://rubygems.org'
+
+rails_version = '~> 2.0.4'
+
+gem 'actionpack', rails_version
+gem 'activerecord', rails_version
+
+gem 'rake', '~> 0.8.7'
+gem 'mocha'
+gem 'sqlite3'
+gem 'mysql', :group => :mysql
+gem 'pg', :group => :pg
@@ -0,0 +1,25 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionpack (2.0.5)
+ activesupport (= 2.0.5)
+ activerecord (2.0.5)
+ activesupport (= 2.0.5)
+ activesupport (2.0.5)
+ mocha (0.9.12)
+ mysql (2.8.1)
+ pg (0.11.0)
+ rake (0.8.7)
+ sqlite3 (1.3.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ actionpack (~> 2.0.4)
+ activerecord (~> 2.0.4)
+ mocha
+ mysql
+ pg
+ rake (~> 0.8.7)
+ sqlite3
View
@@ -0,0 +1,12 @@
+source 'http://rubygems.org'
+
+rails_version = '~> 2.1.0'
+
+gem 'actionpack', rails_version
+gem 'activerecord', rails_version
+
+gem 'rake', '~> 0.8.7'
+gem 'mocha'
+gem 'sqlite3'
+gem 'mysql', :group => :mysql
+gem 'pg', :group => :pg
@@ -0,0 +1,25 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionpack (2.1.2)
+ activesupport (= 2.1.2)
+ activerecord (2.1.2)
+ activesupport (= 2.1.2)
+ activesupport (2.1.2)
+ mocha (0.9.12)
+ mysql (2.8.1)
+ pg (0.11.0)
+ rake (0.8.7)
+ sqlite3 (1.3.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ actionpack (~> 2.1.0)
+ activerecord (~> 2.1.0)
+ mocha
+ mysql
+ pg
+ rake (~> 0.8.7)
+ sqlite3
View
@@ -0,0 +1,12 @@
+source 'http://rubygems.org'
+
+rails_version = '~> 2.2.2'
+
+gem 'actionpack', rails_version
+gem 'activerecord', rails_version
+
+gem 'rake', '~> 0.8.7'
+gem 'mocha'
+gem 'sqlite3'
+gem 'mysql', :group => :mysql
+gem 'pg', :group => :pg
@@ -0,0 +1,25 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionpack (2.2.3)
+ activesupport (= 2.2.3)
+ activerecord (2.2.3)
+ activesupport (= 2.2.3)
+ activesupport (2.2.3)
+ mocha (0.9.12)
+ mysql (2.8.1)
+ pg (0.11.0)
+ rake (0.8.7)
+ sqlite3 (1.3.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ actionpack (~> 2.2.2)
+ activerecord (~> 2.2.2)
+ mocha
+ mysql
+ pg
+ rake (~> 0.8.7)
+ sqlite3
View
@@ -1,10 +1,6 @@
require 'test/unit'
-require 'rubygems'
-
-# gem install redgreen for colored test output
-begin require 'redgreen'; rescue LoadError; end
-
-require 'boot' unless defined?(ActiveRecord)
+require 'mocha'
+require 'will_paginate'
class Test::Unit::TestCase
protected
@@ -29,9 +25,5 @@ def collect_deprecations
# Wrap tests that use Mocha and skip if unavailable.
def uses_mocha(test_name)
- require 'mocha'
-rescue LoadError
- $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
-else
yield
end
@@ -35,9 +35,14 @@ def assert_queries(num = 1)
assert_equal num, $query_count, "#{$query_count} instead of #{num} queries were executed."
end
+ def method_name
+ 'moo' # hack
+ end
+
def assert_no_queries(&block)
assert_queries(0, &block)
end
end
ActiveRecordTestConnector.setup
+abort unless ActiveRecordTestConnector.able_to_connect
Oops, something went wrong.

0 comments on commit 11a97db

Please sign in to comment.