On Jan 31, 2011, at 3:38 AM, Evgeniy Dolzhenko wrote:
> Btw. there is also before(:suite), and working from there wouldn't it make
> sense to have
>
> 1. before(:suite)
> 2. before(:group)
> 3. before(:example)
>
> which would reflect the hierarchy of RSpec run (i.e. suite > group > example).
On Jan 31, 2011, at 3:38 AM, Evgeniy Dolzhenko wrote:
> Btw. there is also before(:suite), and working from there wouldn't it make
> sense to have
>
> 1. before(:suite)
> 2. before(:group)
> 3. before(:example)
>
> which would reflect the hierarchy of RSpec run (i.e. suite > group > example).
Btw. there is also before(:suite), and working from there wouldn't it
make sense to have
1. before(:suite)
2. before(:group)
3. before(:example)
which would reflect the hierarchy of RSpec run (i.e. suite > group >
example).
Anyway likely it's too late to introduce something like this, just m
On Jan 27, 2011, at 6:53 PM, Rick DeNatale wrote:
> On Thu, Jan 27, 2011 at 6:16 PM, David Chelimsky wrote:
>> On Jan 27, 2011, at 5:11 PM, John Feminella wrote:
>>
>>> That's not quite right. :each runs before _each_ spec, while :all runs
>>> once, before _any_ spec.
>>
>> Perhaps :any is a b
El 28/01/2011, a las 03:53, Rick DeNatale escribió:
> On Thu, Jan 27, 2011 at 6:16 PM, David Chelimsky wrote:
>> On Jan 27, 2011, at 5:11 PM, John Feminella wrote:
>>
>>> That's not quite right. :each runs before _each_ spec, while :all runs
>>> once, before _any_ spec.
>>
>> Perhaps :any is a
Not to shoot my own patch in the foot, but my personal opinion is to
have only one way to do it. I think whatever ambiguity there may be in
before(:all) isn't adequately compensated by the additional confusion
of having before(:any), which sounds like it would do something subtly
different.
--
John
On Thu, Jan 27, 2011 at 8:53 PM, Rick DeNatale wrote:
> On Thu, Jan 27, 2011 at 6:16 PM, David Chelimsky wrote:
>> On Jan 27, 2011, at 5:11 PM, John Feminella wrote:
>>
>>> That's not quite right. :each runs before _each_ spec, while :all runs
>>> once, before _any_ spec.
>>
>> Perhaps :any is a
My understanding is that the before :each block runs before every example.
While before :all blocks run once for the entire example group.
Any side effects in the examples will be persist for objects if you use a
before :all block. But if you were to use before :each, you guarantee the
state befor
On Thu, Jan 27, 2011 at 6:16 PM, David Chelimsky wrote:
> On Jan 27, 2011, at 5:11 PM, John Feminella wrote:
>
>> That's not quite right. :each runs before _each_ spec, while :all runs
>> once, before _any_ spec.
>
> Perhaps :any is a better name? We could add it as an alternative for the same
>
> Perhaps :any is a better name? We could add it as an alternative for the same
> as :all. WDYT?
I think that's an interesting idea, David. I whipped up a quick pull
request, which you can see here:
https://github.com/rspec/rspec-core/pull/293
~ jf
--
John Feminella
Principal Consultant, BitsBu
That does clear it. Thank you =]
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
On Jan 27, 2011, at 5:11 PM, John Feminella wrote:
> That's not quite right. :each runs before _each_ spec, while :all runs
> once, before _any_ spec.
Perhaps :any is a better name? We could add it as an alternative for the same
as :all. WDYT?
> --
> John Feminella
> Principal Consultant, BitsB
That's not quite right. :each runs before _each_ spec, while :all runs
once, before _any_ spec.
--
John Feminella
Principal Consultant, BitsBuilder
LI: http://www.linkedin.com/in/fjsquared
SO: http://stackoverflow.com/users/75170/
On Thu, Jan 27, 2011 at 17:56, Brian Warner wrote:
> I'm having
Here's an illustrative example that should clear things up:
require 'spec_helper'
describe "behavior of before-each and before-all" do
before(:all) { puts "-- running :all" }
before(:each) { puts "-- running :each" }
describe "addition" do
it "should add two and two" do
(2 + 2).s
I'm having a hard time grasping the difference between :each and :all.
If I have a bunch of stuff inside a "before :each" block. Everytime I
try to run an example that block of code will be run before the example.
Now if I had the same code inside a "before :all" block. Everytime an
example is ru
15 matches
Mail list logo