Skip to content

Commit

Permalink
fix: allow to use stanalone rspec-rails
Browse files Browse the repository at this point in the history
Проблема: Если подлючен только rspec-rails то тут падает с ошибкой
```
bundler: failed to load command: rspec (/usr/local/gems/bin/rspec)
LoadError: cannot load such file -- rspec/version
```

Как работало раньше:
Обычно подключают 2 гема rspec и rspec-rails
Но это не совсем правильно так как достаточно одного rspec-rails
  • Loading branch information
artofhuman committed Jul 22, 2016
1 parent 467cf7e commit 2ff5f9c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/sphinx/integration/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ class Railtie < Rails::Railtie
end

initializer 'sphinx_integration.rspec' do
if defined?(::RSpec)
require 'rspec/version'
if Gem::Version.new(RSpec::Version::STRING) >= Gem::Version.new('3.0.0')
if defined?(::RSpec::Core)
if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new('3.0.0')
RSpec.configure do |c|
c.before(:each) do |example|
unless example.metadata.fetch(:with_sphinx, false)
Expand Down

0 comments on commit 2ff5f9c

Please sign in to comment.