ruby on rails - before(:each) vs just before -


i new ruby on rails. , playing around testing

is there difference between

before(:each)    #some test code end 

and

before   #some test code end 

the before method accepts scope parameter defaults :each. when leave out, it's implied mean :each, 2 examples exact same thing.

here helpful tidbit rspec rdoc, module: rspec::core::hooks#before:

parameters:

  • scope (symbol) — :each, :all, or :suite (defaults :each)
  • conditions (hash) — constrains hook examples matching these conditions e.g. before(:each, :ui => true) { ... } run examples or groups declared :ui => true.

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -