Skip to content

Instantly share code, notes, and snippets.

@amitpatelx
Created March 16, 2012 09:55
Show Gist options
  • Save amitpatelx/2049338 to your computer and use it in GitHub Desktop.
Save amitpatelx/2049338 to your computer and use it in GitHub Desktop.
Show usage difference between before and let helper of RSpec
# Using before method
before do
@customer = Customer.new(:name => "Amazon")
end
it "should be valid" { @customer.should be_valid }
# Using let method
let(:customer) { Customer.new(:name => "Amazon") }
it "should be valid" { customer.should be_valid }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment