Skip to content

Instantly share code, notes, and snippets.

View technicalpickles's full-sized avatar

Josh Nichols technicalpickles

View GitHub Profile
def whack(objects)
objects.inject({}) do |results, o|
results[o.table_name] = o.delete_all
results
end
end
intervals = []
time = @start_time
while (time < @end_time)
intervals << [time, time.next_interval]
time = time.next_interval
end
## Time ext
class Time
describe MakesController do
fixtures :users
integrate_views
describe "index should be visible to" do
# this is a macro that just pumps out three tests: log in anonymous, log in as a user, log in as an admin
it_should_behave_like "check all users"
before do
# http://gist.github.com/10524
# Prevents autotest from running your entire test suite after fixing a failed test.
# Works with ZenTest 3.10.0
# Place this in your .autotest file:
require 'rubygems'
require 'active_support'
class Autotest
def run_with_not_rerunning_everything
hook :initialize