I have a test suite that runs across several versions of a software application. I’d like to be able to tag those tests that vary based on different versions so that the filters I have set up only run the tests for this particular version.
I’m looking for something like:
describe "the magic page", :version=>["all-magic", "some_magic"]
it "exists!"
end
describe "the magic page", :version=>["no-magic"]
it "does not exist!"
end
Rspec.configure do |config|
this_version= some_version_parameter_passed_in || "no_magic"
config.filter_run :version includes this_version
end
Obviously, that doesn’t work, but it should give you an idea of what I’m trying to accomplish.
You can actually do this with Rspec. Take a look at the docs, and try something like this:
Then to run the tests with the magic tag you can use the command:
Or you can edit your
.rspec:Does this work for you?