Skip to content

Instantly share code, notes, and snippets.

View calebwoods's full-sized avatar

Caleb Woods calebwoods

View GitHub Profile
@calebwoods
calebwoods / gist:1254706
Created September 30, 2011 19:13
MySQL Issue RVM: Run this command from terminal to fix the mysql2 issues with rvm. Assumes the gem is installed in the global gemset.
sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib ~/.rvm/gems/ruby-1.9.3-p0@global/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
@calebwoods
calebwoods / gist:1254258
Created September 30, 2011 16:18
Failing PUT
describe "with invalid params" do
it "assigns the snippet as @snippet" do
snippet = FactoryGirl.create(:snippet)
# Trigger the behavior that occurs when invalid params are submitted
Snippet.any_instance.stub(:save).and_return(false)
put :update, :id => snippet.id.to_s, :snippet => {}
assigns(:snippet).should eq(snippet)
end
it "re-renders the 'edit' template" do
@calebwoods
calebwoods / development.rb
Created September 28, 2011 14:05
Replace Rails Console with Pry
MyApp::Application.configure do
silence_warnings do
begin
require 'pry'
IRB = Pry
rescue LoadError
end
end
end