Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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