Created
July 9, 2011 13:20
-
-
Save pivotal-casebook/1073577 to your computer and use it in GitHub Desktop.
Gemfile and spec_helper with Spork
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '3.1.0.rc4' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'pg' | |
# Asset template engines | |
gem 'sass-rails', "~> 3.1.0.rc" | |
gem 'coffee-script' | |
gem 'uglifier' | |
gem 'jquery-rails' | |
gem "haml" | |
gem "compass" | |
gem "sass" | |
gem "compass-susy-plugin" | |
gem "devise" | |
gem "heroku" | |
gem "money" | |
gem "cancan" | |
gem "simple_form" | |
gem "fog" | |
gem "carrierwave" | |
# gem "rmagick", :require => 'RMagick' | |
#gem "mc-settings", :git => "git://github.com/modcloth/mc-settings.git" | |
# Use unicorn as the web server | |
# gem 'unicorn' | |
# Deploy with Capistrano | |
# gem 'capistrano' | |
group :production do | |
gem 'therubyracer-heroku' | |
end | |
# To use debugger | |
# gem 'ruby-debug19', :require => 'ruby-debug' | |
group :development, :test do | |
gem 'rspec-rails' | |
gem 'cucumber-rails' | |
gem 'spork', ">= 0.9.0.rc8" | |
gem 'database_cleaner' | |
gem 'passenger' | |
gem 'jasmine' | |
gem 'factory_girl_rails', :require => false | |
gem 'remarkable_activerecord', ">= 4.0.0.alpha4" | |
gem 'turn', :require => false | |
gem 'faker' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'spork' | |
Spork.prefork do | |
require "rails/application" | |
# Prevent Devise from loading the User model super early with it's route hacks for Rails 3.1 rc4 | |
# see also: https://github.com/timcharper/spork/wiki/Spork.trap_method-Jujutsu | |
Spork.trap_method(Rails::Application, :reload_routes!) | |
Spork.trap_method(Rails::Application::RoutesReloader, :reload!) | |
# Loading more in this block will cause your tests to run faster. However, | |
# if you change any configuration or code from libraries loaded here, you'll | |
# need to restart spork for it take effect. | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'remarkable/active_record' | |
# Requires supporting ruby files with custom matchers and macros, etc, | |
# in spec/support/ and its subdirectories. | |
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
RSpec.configure do |config| | |
# == Mock Framework | |
# | |
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: | |
# | |
# config.mock_with :mocha | |
# config.mock_with :flexmock | |
# config.mock_with :rr | |
config.mock_with :rspec | |
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures | |
config.fixture_path = "#{::Rails.root}/spec/fixtures" | |
# If you're not using ActiveRecord, or you'd prefer not to run each of your | |
# examples within a transaction, remove the following line or assign false | |
# instead of true. | |
config.use_transactional_fixtures = true | |
config.include Devise::TestHelpers, :type => :controller | |
end | |
# reload routes post-prefork -- trap for Devise | |
end | |
Spork.each_run do | |
# This code will be run each time you run your specs. | |
require 'factory_girl_rails' | |
Factory.definition_file_paths = [ | |
File.join(Rails.root, 'spec', 'factories') | |
] | |
Factory.find_definitions | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment