Hi I got lots of warning when run rspec
which does annoying me too much,
How to fix it ? because I\'ve tried the Ruby version 2.1.2
under
These are warnings emitted by rspec because of a circular dependency. Likely this is a mix of require
statements that are no longer correct. (I believe as of RSpec 3.0.)
If this is a Rails app:
rails_helper.rb
, you should use the rails g rspec:install
to set this up. rails_helper.rb
requires spec_helper
, and it contains things that are specific to Rails..rspec
file includes --require 'rails_helper'
and that it is checked in to source control.require 'spec_helper'
or require 'rails_helper'
from the top of any spec files.If this is not a Rails app:
.rspec
file includes --require 'spec_helper'
and that it is checked in to source control.require 'spec_helper'
from the top of any spec files.This will ensure that the dependencies are only loaded once, regardless of whether you run rspec on a specific file or for all of them.