Skip to content

Instantly share code, notes, and snippets.

@joeldrapper
joeldrapper / attribute_memoization.rb
Last active December 13, 2022 12:24
Attribute Memoization
module AttributeMemoization
def attr_accessor(*names, &block)
return super(*names) unless block_given?
attr_reader(*names, &block)
attr_writer(*names)
end
def attr_reader(*names, &block)
return super(*names) unless block_given?
@mariochavez
mariochavez / migration.md
Created February 6, 2017 17:30
RSpec to Minitest

These are the scripts that I used to migrate from RSpec to Minitest in a Rails aplication.

It is expected for the test suite to be in RSpec 3.x sintax.

  1. Install rename library from Homebrew
  2. Remove RSpec/TestUnit from Gemfile
  3. Add minitest-rails gem
  4. Rename spec forder to test
  5. Add a test_helper.rb file