Skip to content

Instantly share code, notes, and snippets.

@myronmarston
myronmarston / explanation.md
Last active October 22, 2020 18:16
Explanation for why `its` will be removed from rspec-3

its isn't core to RSpec. One the of the focuses of RSpec is on the documentation aspects of tests. Unfortunately, its often leads to documentation output that is essentially lies. Consider this spec:

User = Struct.new(:name, :email)

describe User do
  subject { User.new("bob") }
  its(:name) { should == "bob" }
end
@apeiros
apeiros / seeds.rb
Created May 26, 2011 17:22
A beefed up seeds file for rails
require 'pp'
puts "Seeding for env '#{Rails.env}'"
# disable AR logger
old_logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil unless $VERBOSE
env_seed_file = "#{Rails.root}/db/data/seed/#{Rails.env.downcase}/seeds.rb"
# first load yaml files that is "base" loading