Last active
June 10, 2017 05:02
-
-
Save adamhunter/5687248 to your computer and use it in GitHub Desktop.
All that is required to bootstrap a basic rails application for a test suite.
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
# spec/dummy/config/application.rb | |
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../../../Gemfile', __FILE__) | |
require 'rubygems' | |
require 'bundler' | |
Bundler.setup | |
$:.unshift File.expand_path('../../../../lib', __FILE__) | |
# for everything: require "rails/all" | |
require "action_controller/railtie" | |
Bundler.require | |
ApplicationController = Class.new(ActionController::Base) | |
require 'your_gem' | |
module Dummy | |
class Application < ::Rails::Application | |
config.cache_classes = true | |
config.active_support.deprecation = :stderr | |
config.secret_token = 'http://s3-ec.buzzfed.com/static/enhanced/webdr03/2013/5/25/8/anigif_enhanced-buzz-11857-1369483324-0.gif' | |
end | |
end | |
Dummy::Application.initialize! |
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
# spec/dummy/config.ru | |
require File.expand_path('../config/application', __FILE__) | |
run Dummy::Application |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See gist at revision: https://gist.github.com/adamhunter/5687248/c2e908f5249130c050af74db1c26dfa6a565c980 for
Rakefile
andscript/rails
(they'd be in your gem root).