Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created August 4, 2021 07:43
Show Gist options
  • Save myronmarston/8fea012b9eb21b637335bb29069bce6b to your computer and use it in GitHub Desktop.
Save myronmarston/8fea012b9eb21b637335bb29069bce6b to your computer and use it in GitHub Desktop.
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