Skip to content

Instantly share code, notes, and snippets.

View adamrobbie's full-sized avatar

Adam Robbie adamrobbie

View GitHub Profile
@jwreagor
jwreagor / assert_queue.rb
Last active December 15, 2015 04:59
AssertQueue: An abstraction for testing background queuing in MiniTest, specifically Sidekiq
module AssertQueue
def assert_queued(klass, args)
assert AssertQueue.includes?(klass, args), "Queue should contain #{klass} with args #{args.inspect}\n#{AssertQueue.queue.inspect}"
end
def self.included(base)
Sidekiq::Client.instance_eval do
def push(item)
AssertQueue.queue.push item
@subelsky
subelsky / puma_rails_heroku.rb
Created October 31, 2012 13:51
Setting up Puma and Rails on Heroku
# Gemfile
gem "puma"
# Procfile
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb
# add to config block config/environments/production.rb
config.threadsafe!
# get rid of NewRelic after_fork code, if you were doing this: