Skip to content

Instantly share code, notes, and snippets.

@pecavalheiro
Forked from jerelmiller/custom_plan.rb
Last active February 5, 2021 15:10
Show Gist options
  • Select an option

  • Save pecavalheiro/5b8a007e047d8e907ee7e905b9aa37d4 to your computer and use it in GitHub Desktop.

Select an option

Save pecavalheiro/5b8a007e047d8e907ee7e905b9aa37d4 to your computer and use it in GitHub Desktop.
Zeus Test Console
# frozen_string_literal: true
require 'zeus/rails'
class Pry::Pager
def best_available
NullPager.new(pry_instance.output)
end
end
class CustomPlan < Zeus::Rails
# def my_custom_command
# # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
# end
def default_bundle_with_test_env
::Rails.env = 'test'
ENV['RAILS_ENV'] = 'test'
default_bundle
end
def test_console
console
end
end
Zeus.plan = CustomPlan.new
{
"command": "ruby -rrubygems -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": {
"test_helper": {"test": ["rspec"]},
"test_console": ["tc"]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment