On 1 Oct 2011, at 00:36, Srushti Ambekallu wrote:
> On 30/09/11 6:24 PM, Patrick J. Collins wrote:
>> So regarding objects persisting over multiple examples-- I was told
>> repeatedly
>> by experienced RSpec peeps to not use before(:all)…
>
> I don't know if object creation (including the corr
On 30/09/11 6:24 PM, Patrick J. Collins wrote:
Proper usage, sure, but the memoization is only within each example - not
across examples. That way you can do this:
So regarding objects persisting over multiple examples-- I was told repeatedly
by experienced RSpec peeps to not use before(:all)..
> Proper usage, sure, but the memoization is only within each example - not
> across examples. That way you can do this:
So regarding objects persisting over multiple examples-- I was told repeatedly
by experienced RSpec peeps to not use before(:all)...
But in a case like:
before(:each) do
@u
On Sep 30, 2011, at 4:32 PM, Srushti Ambekallu wrote:
> On 30/09/11 3:58 PM, David Chelimsky wrote:
>> On Sep 30, 2011, at 3:31 PM, Patrick J. Collins wrote:
>>
Proper usage, sure, but the memoization is only within each example - not
across examples. That way you can do this:
>
On 30/09/11 3:58 PM, David Chelimsky wrote:
On Sep 30, 2011, at 3:31 PM, Patrick J. Collins wrote:
Proper usage, sure, but the memoization is only within each example - not
across examples. That way you can do this:
let(:thing) { Thing.new }
it "does something" do
thing.blah
thing.whatev
On Sep 30, 2011, at 3:31 PM, Patrick J. Collins wrote:
>> Proper usage, sure, but the memoization is only within each example - not
>> across examples. That way you can do this:
>>
>> let(:thing) { Thing.new }
>>
>> it "does something" do
>> thing.blah
>> thing.whatever
>> thing.yet_again
>>
> Proper usage, sure, but the memoization is only within each example - not
> across examples. That way you can do this:
>
> let(:thing) { Thing.new }
>
> it "does something" do
> thing.blah
> thing.whatever
> thing.yet_again
> end
>
> In that case each reference to thing returns the same
On Sep 30, 2011, at 2:48 PM, Patrick J. Collins wrote:
> Am I correct in understanding that the point of using let is that it can
> minimize database calls due to memoization?
>
> describe "#something" do
>
> let(:something) = Something.groovy_scope
>
> it "does x" do
>something.first.x.s
Am I correct in understanding that the point of using let is that it can
minimize database calls due to memoization?
describe "#something" do
let(:something) = Something.groovy_scope
it "does x" do
something.first.x.should have_coolness
end
it "does y" do
something.first.y.
> Am I correct in understanding that the point of using let is that it can
> minimize database calls due to memoization?
>
> describe "#something" do
>
> let(:something) = Something.groovy_scope
and obviously I meant let(:something) { ... }, not =
(oops)...
Patrick J. Collins
http://collinat
10 matches
Mail list logo