[rspec-users] Assign default tag

Perry Smith pedzsan at gmail.com
Tue Mar 19 16:52:29 UTC 2013

On Mar 19, 2013, at 10:41 AM, David Chelimsky wrote:

> On Tue, Mar 19, 2013 at 7:20 AM, Иван Неверов <ivan.neverov at gmail.com> wrote:
>> Hi all
>> Could somebody tell me, is it possible to assign some tag=>value to all
>> examples in directory?
>> Like I want to mark all tests in spec/unit as :type=>'shallow'. And have
>> some tests in other directory also with type shallow (assigned in describe)
>> And then filter them with -t type:shallow
>> Thanks
>> Ivan
> Unfortunately, there's nothing built in to support this. I'd recommend
> you submit a feature request to
> http://github.com/rspec/rspec-core/issues.

I do this:

    config.include RSpec::Rails::ViewExampleGroup, type: :presenter, example_group: {
      file_path: config.escaped_path(%w[spec presenters])

and it appears to work for me.  But David would know better than I.

Am I fooling myself somehow?  Or did I misunderstand the question?


More information about the rspec-users mailing list