rspec/rspec-rails — pull request #1002 by myronmarston (2014-04-21 18:28:30+00:00)
Title: WIP: Fix spec type inferrence

Fix spec type inferrence.

- In #970 we added `infer_spec_type_from_file_location!` but forgot
to remove the code in `lib/rspec/rails/configuration.rb` that
made it always infer - so the opt-in API was there but it
was always enabled. Here I've made it truly opt-in.
- The logic of `infer_spec_type_from_file_location!` also setup
the helper module inclusion via explicit `:type` metadata but
was only intended to setup the implicit mapping of spec file
location to type. Here I've made the module inclusion via
`:type` always work w/o an explicit config option needed to
enable it.
- We used to mutate the `:type` metadata on inclusion of the helper
module, but this caused bugs such as #825. The problem is that
rspec-core uses a raw hash for the metadata and doesn't re-apply
filtering/inclusion logic when the metadata hash is mutated.
Instead, we use a new explicit `define_derived_metadata` API.

Fixes #825 and closes #829.

/cc @JonRowe @cupakromer @alindeman @xaviershay