Skip to content

Instantly share code, notes, and snippets.

View cgunther's full-sized avatar

Chris Gunther cgunther

View GitHub Profile
@cgunther
cgunther / issue_13747.rb
Created June 3, 2014 01:17
Regression from 3.2.18 to 4.0.5
# Activate the gem you are reporting the issue against.
# gem 'activerecord', '3.2.18'
gem 'activerecord', '4.0.5'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
@cgunther
cgunther / Gemfile
Created March 15, 2013 02:21
When it tries to preload the active colors, it must first load the Skus, but it applies the order condition when querying for Skus
# A sample Gemfile
source "https://rubygems.org"
gem 'rails', '3.2.12'
gem 'sqlite3'
@cgunther
cgunther / agent.rb
Created August 8, 2012 20:18 — forked from lrowe/agent.rb
Ruby file causes SublimeLinter to crash
require 'tempfile'
require 'net/ntlm'
require 'kconv'
require 'webrobots'
##
# An HTTP (and local disk access) user agent. This class is an implementation
# detail and is subject to change at any time.
class Mechanize::HTTP::Agent
def test_sets_settings_with_hash
user = User.create :name => 'Mr. Foo'
user.settings[:one] = 1
user.settings[:two] = 2
user.settings = { :two => 'two', :three => 3 }
assert_equal 1, user.settings[:one]
assert_equal 'two', user.settings[:two]
assert_equal 3, user.settings[:three] # ensure existing settings remain intact
end
@cgunther
cgunther / test_helper.rb
Created May 20, 2011 13:19
Paperclip stubbing
module Paperclip
# We don't need to be testing that thumbnails are created
class Attachment
private
def post_process_styles
true
end
end
class Geometry