Many thanks to David C. for answering my question about :type &
:behaviour_type hash key:
It has made me curious to know whether tagging specs is a feature anyone
The current project i’m working on has a vast number of specs - most
selenium - and consequently a very long build (cruisecontrol).
We have a few of different independant streams of development, all
on the same codebase, each having an associated ‘precheckin’ build. We
to make sure these only take up to 10-15 mins by running a relevant
of the specs. We’d ideally run the full build locally before every
but we optimistically commit when the relevant precheckin build passes
so we can check in more frequently (the build server always runs the
build). There’s effort going into reduing the overall build time
grid and various other ideas) but this is a reasonable option right now.
Currently we achieve this crudely by having a custom spec runner that
specs according to whether the filename matches a set of inclusion
expressions and doesn’t match a set of exclusion regular expressions
stream has a set of filters). A simpler method might have just been to
the specs in different directories but it’s convenient to be able to
the same spec in more than one of these precheckin builds.
It would be really cool to have just been able to write specs like this:
describe ‘some piece of functionality’, :tags => [:ui, :search] do
describe ‘some other piece of functionality’, :tags => [:ui] do
and then execute only the first spec as a result of launching something
‘spec --tags search’ - all of the specs can be loaded but only those
match the specified tag would be executed.
Having poked around the code a little, it doesn’t seem impossibly
Does the idea have any appeal to anyone? It doesn’t seem an especially
original idea so I wonder if anyone has already had a go at implementing