Skip to content

Instantly share code, notes, and snippets.

View eonu's full-sized avatar

Edwin (Ed) Onuonga eonu

View GitHub Profile
@ubermajestix
ubermajestix / inspector.rb
Created September 5, 2012 20:35
Override inspect on ruby objects
# When an RSpec test like this fails,
#
# @my_array.should == [@some_model, @some_model2]
#
# RSpec will call inspect on each of the objects to "help" you figure out
# what went wrong. Well, inspect will usually dump a TON OF SHIT and make trying
# to figure out why `@my_array` is not made up of `@some_model` and `@some_model2`.
#
# This little module and technique helps get around that. It will redefine `inspect`
# if you include it in your model object.
@bartlomiejdanek
bartlomiejdanek / .irbrc
Created December 20, 2011 19:23
IRB configuration
# Make gems available
require 'rubygems' if RUBY_VERSION <= '1.9.0'
# http://drnicutilities.rubyforge.org/map_by_method/
require 'map_by_method'
# Dr Nic's gem inspired by
# http://redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html
require 'what_methods'