Skip to content

Instantly share code, notes, and snippets.

View denis's full-sized avatar

Denis Barushev denis

View GitHub Profile
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
it 'finds posts containing the given word in the title' do
# The titles are in a different file than the test, so you need to flip back and forth to see
# what's actually going on here. When somebody adds another example post to the fixtures, this
# test will start failing, which is a distraction and a waste of time. We were also never able to
# come up with fixtures that weren't either hopelessly entangled or completely bloated from adding
# a specific fixture for almost every test.
Post.search('example').map(&:title).should =~ ['example one', 'example two']
end
it 'finds posts containing the given word in the title' do
module Paperclip
class Geometry
def self.from_file file
parse("100x100")
end
end
class Thumbnail
def make
src = Test::FileHelper.fixture_file('white_pixel.jpg')
dst = Tempfile.new([@basename, @format].compact.join("."))