Created
March 16, 2012 09:55
-
-
Save amitpatelx/2049338 to your computer and use it in GitHub Desktop.
Show usage difference between before and let helper of RSpec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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