lundi 8 janvier 2018

Using RSpec to loop through multiple spec groups

I'm somewhat new to this so bear with.

I'm trying to execute several groups of tests independently via RSpec::Core

# Example
spec_groups = [['spec', 'spec2'], ['spec3', 'spec4']]

spec_groups.each do |spec_group|
  RSpec::Core::Runner.run([spec_group])
  RSpec.clear_examples
end

Two groups of specs - I want to loop through and run them all via the RSpec::Core::Runner.

RSpec.configuration.fail_fast = true will skip remaining specs in a group if any fail (if from group 1 spec fails it will not run spec2) but also seems to prevent any further groups from being run at all.

Question

If a spec from a group fails - how do I skip the rest of that group and move onto the next one?

Aucun commentaire:

Enregistrer un commentaire