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

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

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

javascript - Chart.js - setting tooltip z-index -