Hi Brent

We don’t actually want to extend the type inference api, as we consider it a 
legacy feature at this point, explicit meta data is far more readable and less 
magic.

So an alternative solution would be to tag the top level describes with the 
key, or keys you wish to trigger these shared examples, and have them 
automatically included via the metadata filtering. The docs you may be looking 
for are here: 
https://relishapp.com/rspec/rspec-core/v/3-8/docs/helper-methods/define-helper-methods-in-a-module

Cheers
Jon Rowe
---------------------------
[email protected]
jonrowe.co.uk

On 3 December 2018 at 17:26, [email protected] wrote:
> Hi there,
>
> We have a bunch of similar specs that share helpers in a subdirectory of 
> `spec/` and were wondering if we could just extend rspec-rails' type 
> inference based on the spec file's location to give them all a specific 
> "type" and include helpers based on that type. When we popped open the source 
> code we found that the mapping of types to locations happens in a hash 
> constant (`RSpec::Rails::DIRECTORY_MAPPINGS`) that is marked as private.
>
> Would the maintainers be open to a PR that opened up a public API for 
> registering new type/file location configurations? If so I'd be happy to open 
> something!
>
> Cheers,
>
> Brent

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/dejalu-192-1d3cdf68-8e23-4d71-8c3a-282b812289e6%40jonrowe.co.uk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to