/ rails

ZEUS test_environment

Just found that I couldn't do zeus c test for a test environment console

Here's a workaround or small hack to do this

Steps

On your console do

 zeus init

This will create two files

 zeus.json
custom_plan.rb

Add this snippet to your custom_plan.rb and define the tasks for Zeus. Mine looks like this:

require 'zeus/rails'

class CustomPlan < Zeus::Rails
  def default_bundle_with_test_env
    ::Rails.env = 'test'
    ENV['RAILS_ENV'] = 'test'
    default_bundle
  end

  def test_server
    server
  end

  def test_console
    console
  end

  def test_rake
    prerake
    rake
  end
end

Edit zeus.json to include only the tasks for which you’ll use Zeus. Mine looks like this:

{
  "command": "ruby -rubygems -r./custom_plan -eZeus.go",

  "plan": {
    "boot": {
      "default_bundle": {
        "development_environment": {
          "prerake": {"rake": []},
          "runner": ["r"],
          "console": ["c"],
          "server": ["s"],
          "generate": ["g"],
          "destroy": ["d"],
          "dbconsole": []
        },
        "test_environment": {
          "cucumber_environment": {"cucumber": []},
          "test_helper": {"test": ["rspec", "testrb"]},
          "test_server": ["ts"],
          "test_rake":   ["tr"],
          "test_console": ["tc"]
        }
      }
    }
  }
}

Reference [improving-rails-boot-time-with-zeus][1]
[1]: http://robots.thoughtbot.com/post/40193452558/improving-rails-boot-time-with-zeus