Created
August 4, 2021 07:43
-
-
Save myronmarston/8fea012b9eb21b637335bb29069bce6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
source 'https://rubygems.org' | |
gem "rspec", "~> 3.10" | |
end | |
require "rspec/autorun" | |
RSpec.configure do |config| | |
config.register_ordering :global do |items| | |
by_suite = items.group_by { |g| g.metadata.fetch(:suite) } | |
# run veggies before fruits | |
by_suite.fetch(:veggie) { [] }.shuffle + by_suite.fetch(:fruit) { [] }.shuffle | |
end | |
end | |
RSpec.describe "Broccoli", suite: :veggie do | |
it "runs" do | |
puts("🥦") | |
end | |
end | |
RSpec.describe "Pear", suite: :fruit do | |
it "runs" do | |
puts("🍐") | |
end | |
end | |
RSpec.describe "Pepper", suite: :veggie do | |
it "runs" do | |
puts("🌶") | |
end | |
end | |
RSpec.describe "Apple", suite: :fruit do | |
it "runs" do | |
puts("🍎") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment