Skip to content

Instantly share code, notes, and snippets.

@releu
Created April 12, 2012 08:11
Show Gist options
  • Save releu/2365557 to your computer and use it in GitHub Desktop.
Save releu/2365557 to your computer and use it in GitHub Desktop.
rspec: let and let!
describe(:let) do
let(:smth) { Smth.create! }
it { Smth.count.should == 0 }
it { smth; Smth.count.should == 1 }
end
describe(:let!) do
let!(:smth) { Smth.create! }
it { Smth.count.should == 1 }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment