Skip to content

Instantly share code, notes, and snippets.

@adamgoucher
Created February 5, 2011 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamgoucher/812694 to your computer and use it in GitHub Desktop.
Save adamgoucher/812694 to your computer and use it in GitHub Desktop.
example of how to use tags with rspec. more importantly, how to use multiple tags
# see https://github.com/rspec/rspec-core/commit/aa6f7e8744abb4bdc2060fb32a58bd2aeea04e14
describe "rabbit holes" do
#
# single tags - can be either but not both
#
# rspec --tag depth:shallow tags.rb
# rspec --tag depth:deep tags.rb
#
# multiple tags
#
# rspec --tag authentication --tag registration tags.rb
#
it "are shallow", :depth => 'shallow' do
print "shallow!"
end
it "are deep", :depth => 'deep' do
print "deep!"
end
it "are multiple shallow", :depth => 'shallow', :registration => true do
print "registration!"
end
it "are multiple deep", :depth => 'deep', :authentication => true do
print "authentication!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment