I think there's a way to run only tests with a given label. Anybody know?
Ruby – How to run only specific tests in Rspec
rspecruby
Related Topic
- Ruby – Testing modules in RSpec
- Ruby – How to check if a value exists in an array in Ruby
- Ruby – How to pick randomly from an array
- Ruby – When to use RSpec let()
- Ruby – Disable a group of tests in rspec
- Ruby-on-rails – How to run a single RSpec test
- Ruby: How to install a specific version of a ruby gem
- Php – Error (#200) The user hasn’t authorized the application to perform this action facebook graph api php codeigniter
Best Answer
It isn't easy to find the documentation, but you can tag examples with a hash. Eg.
More info on GitHub. (anyone with a better link, please advise)
(update)
RSpec is now superbly documented here. See the --tag option section for details.
As of v2.6 this kind of tag can be expressed even more simply by including the configuration option
treat_symbols_as_metadata_keys_with_true_values
, which allows you to do:describe "Awesome feature", :awesome do
where
:awesome
is treated as if it were:awesome => true
.Also see this answer for how to configure RSpec to automatically run 'focused' tests. This works especially well with Guard.