Skip to content

Commit

Permalink
Add support for Zeus with a custom plan.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristandunn committed Aug 12, 2016
1 parent f112d1b commit add6ded
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
25 changes: 25 additions & 0 deletions pusher_plan.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require "zeus/rails"

class PusherPlan < Zeus::Rails
def test_environment
super

# 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

# Start the fake socket and web servers, but don't kill the server at_exit.
fork { PusherFake::Server.start }
end
end

Zeus.plan = PusherPlan.new
2 changes: 1 addition & 1 deletion spec/support/pusher-fake.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require "pusher-fake/support/rspec"
require "pusher-fake/support/base" unless ENV["ZEUS_MASTER_FD"]
15 changes: 15 additions & 0 deletions zeus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"command" : "ruby -rubygems -r./pusher_plan -eZeus.go",

"plan" : {
"boot" : {
"default_bundle" : {
"test_environment" : {
"test_helper" : {
"test" : ["rspec"]
}
}
}
}
}
}

0 comments on commit add6ded

Please sign in to comment.