Skip to content

Instantly share code, notes, and snippets.

@huoxito
Created May 9, 2013 19:21
Show Gist options
  • Save huoxito/5549834 to your computer and use it in GitHub Desktop.
Save huoxito/5549834 to your computer and use it in GitHub Desktop.
require 'zeus/rails'
ROOT_PATH = File.expand_path(Dir.pwd)
ENV_PATH = File.expand_path('spec/dummy/config/environment.rb', __FILE__)
BOOT_PATH = File.expand_path('spec/dummy/config/boot', ROOT_PATH)
APP_PATH = File.expand_path('spec/dummy/config/application', ROOT_PATH)
class CustomPlan < Zeus::Rails
def test_environment
Bundler.require(:test)
::Rails.env = ENV['RAILS_ENV'] = 'test'
require APP_PATH
$rails_rake_task = 'yup' # lie to skip eager loading
::Rails.application.require_environment!
$rails_rake_task = nil
$LOAD_PATH.unshift ".", "./lib", "./test", "./spec"
end
end
Zeus.plan = CustomPlan.new
{
"command": "ruby -rubygems -r./custom_plan -eZeus.go",
"plan": {
"boot": {
"default_bundle": {
"test_environment": {
"test_helper": {"test": ["rspec", "testrb"]}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment