Created
November 25, 2014 03:38
-
-
Save Domon/8c48d44200da348e5723 to your computer and use it in GitHub Desktop.
Zeus custom plan for pusher-fake. See: https://github.com/tristandunn/pusher-fake/issues/34#issuecomment-61909045.
This file contains hidden or 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
require 'zeus/rails' | |
class CustomPlan < Zeus::Rails | |
def test_environment | |
super | |
# | |
# Copied from pusher-fake/support/base.rb | |
# | |
# Use the same API key and secret as the live version. | |
PusherFake.configure do |configuration| | |
configuration.app_id = Pusher.app_id | |
configuration.key = Pusher.key | |
configuration.secret = Pusher.secret | |
end | |
# Set the host and port to the fake web server. | |
PusherFake.configuration.web_options.tap do |options| | |
Pusher.host = options[:host] | |
Pusher.port = options[:port] | |
end | |
# | |
# Modified from pusher-fake/support/base.rb | |
# | |
# Start the fake socket and web servers, but don't kill the server at_exit. | |
fork { PusherFake::Server.start } | |
end | |
end | |
Zeus.plan = CustomPlan.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment