Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Tests can now be run directly with "rake test". Ran the rails plugin …
Browse files Browse the repository at this point in the history
…generator (with --mountable --full) and found some inspiration there.
  • Loading branch information
Justin Geibel authored and Justin Geibel committed Feb 26, 2011
1 parent 8353749 commit 9fe7bf3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ source 'http://rubygems.org'

gemspec

gem 'sqlite3'

group :development do
gem 'jeweler'
gem 'sqlite3-ruby', :require => 'sqlite3'
end

group :test do
gem 'rails', '3.1.0.beta', :git => 'git://github.com/bborn/rails.git'
gem 'rack', :git => 'git://github.com/rack/rack.git'
gem 'arel', :git => 'git://github.com/rails/arel.git'
Expand All @@ -14,8 +17,6 @@ group :development do
gem 'authlogic', :git => 'git://github.com/bborn/authlogic.git'
gem 'calendar_date_select', :git => 'http://github.com/paneq/calendar_date_select.git', :branch => 'rails3test'
gem 'omniauth', :git => 'https://github.com/intridea/omniauth.git'
end

group :test do
gem 'simplecov'
end
13 changes: 11 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
require 'rake'
require 'rake/testtask'
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end

APP_RAKEFILE = File.expand_path("../test/testapp/Rakefile", __FILE__)
puts APP_RAKEFILE
load 'rails/tasks/engine.rake'

require 'rake/testtask'
task :default => :test

desc 'Runs test:units, test:functionals'
Expand Down
14 changes: 0 additions & 14 deletions test/testapp/Gemfile

This file was deleted.

5 changes: 2 additions & 3 deletions test/testapp/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
require 'yaml'
YAML::ENGINE.yamler= 'syck'

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
Bundler.require
require "community_engine"

module Dummy
class Application < Rails::Application
Expand Down
10 changes: 7 additions & 3 deletions test/testapp/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require 'rubygems'
gemfile = File.expand_path('../../../../Gemfile', __FILE__)

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
$:.unshift File.expand_path('../../../../lib', __FILE__)

0 comments on commit 9fe7bf3

Please sign in to comment.