dimanche 24 avril 2016

spec run the same set of tests with different configuration

Assume a spec file that contains a number of tests:

before(:all) do
   @object = buildObjectA
end

it 'should compute x correctly' do
   test something based on object
end

it 'should compute y correctly' do
   test something based on object
end

I wanted to do the same set of tests but with a different configuration, for example, in before(:all), it looks like this:

before(:all) do
   @object = buildObjectB
end

What is the best way of doing this?

Aucun commentaire:

Enregistrer un commentaire