rspec/rspec-rails — pull request #1087 by cupakromer (2014-06-13 06:00:33+00:00)
Title: Fix smoke task

This is the follow up to #1059, in response to #1058. Most of the work was done with @samphippen during Ruby Nation to flush out the root cause and devise a general solution.

This implements proper setup of the test rails application. Previously the rails app used this gem's `Gemfile` during it's execution. Despite using `Bundler.with_clean_env` in the Rake file, the `Gemfile` still automatically loads the other rspec gems since they are explicitly listed.

Running a rails app which only requires `rspec-rails` per the instructions: `gem 'rspec-rails', '~> 3.0.0', groups: [:development, :test]`, will not automatically require the other gems. The other gems will only be loaded if/when `rspec-rails` requires them. Since this was not properly happening with the generator, the error reported in #1054 occurs.

Unfortunately, the only way to get the proper dependencies to work when running things locally is to actually list the other rspec gems in the Gemfile. By marking them with `:require => false`, we ensure they will not be automatically loaded.

Now that the gems are required in two places, 1) the main gem and 2) the test app, it is possible / likely that they will drift. To prevent this, the main rspec related gems have been moved to a shared Gemfile. This is properly loaded in the main Gemfiles. Thus allowing any changes to be properly picked up.