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__) | |
require "action_controller/railtie" | |
Bundler.require | |
ApplicationController = Class.new(ActionController::Base) | |
require 'dossier/segmenter' | |
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 |
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
# script/rails | |
#!/usr/bin/env ruby | |
APP_PATH = File.expand_path('../../spec/dummy/config/application', __FILE__) | |
require APP_PATH | |
require 'rails/commands' |
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
# Rakefile | |
#!/usr/bin/env rake | |
require "bundler/gem_tasks" | |
require File.expand_path('../spec/dummy/config/application', __FILE__) | |
Dummy::Application.load_tasks |
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).