Skip to content

Instantly share code, notes, and snippets.

View phillipoertel's full-sized avatar

Phillip Oertel phillipoertel

View GitHub Profile
@dblock
dblock / capybara_wait_until.rb
Created July 24, 2013 07:38
Re-implementation of Capybara wait_until.
class Capybara::Session
def wait_until(timeout = Capybara.default_wait_time)
Timeout.timeout(timeout) do
sleep(0.1) until value = yield
value
end
end
end
def defer(&block)
def block.each ; yield call ; end
block
end
app =
lambda do |env|
status = 200
headers = { 'Last-Modified' => exec_sql('SELECT MAX(updated_at) FROM foos').httpdate }