0

I am trying to set up Rspec for the first time. I have deleted all the old generated specs from spec/models and spec/controllers

Gemfile

group :development, :test do
  gem 'jasmine-rails'
  gem "jasmine-core", "~> 1.3"
  gem 'binding_of_caller'
  gem 'rspec-rails', '~> 3.0.0'
  gem 'factory_girl_rails'
end

group :test do
  gem "faker", "~> 1.1.2"
  gem "capybara" 
  gem "database_cleaner", "~> 1.0.1"
  gem "launchy", "~> 2.3.0"
  gem "selenium-webdriver", "~> 2.39.0"
  gem "shoulda-matchers"
end

application.rb

config.generators do |g|
    g.test_framework :rspec,
      fixtures: true,
      view_specs: false,
      helper_specs: false,
      routing_specs: false,
      controller_specs: true,
      request_specs: false
    g.fixture_replacement :factory_girl, dir: "spec/factories"
end

The I ran the rspec generator & rake task

bundle exec rails generate rspec:install
bundle exec rspec

I get 100s of errors (1607 lines worth), starting with:

/home/assay/assay/config/boot.rb:6: warning: File.exists? is a deprecated name, use  File.exist? instead
/home/assay/.rvm/gems/ruby-2.1.2@assay/gems/mysql2-0.3.16/lib/mysql2/error.rb:22: warning: method redefined; discarding old sql_state=
/home/assay/.rvm/gems/ruby-2.1.2@assay/gems/sass-3.2.19/lib/sass/version.rb:5: warning: loading in progress, circular require considered harmful - /home/assay/.rvm/gems/ruby-    2.1.2@assay/gems/sass-3.2.19/lib/sass.rb
from /home/assay/.rvm/gems/ruby-2.1.2@assay/bin/ruby_executable_hooks:15:in  `<main>'
from /home/assay/.rvm/gems/ruby-2.1.2@assay/bin/ruby_executable_hooks:15:in  `eval'
from /home/assay/.rvm/gems/ruby-2.1.2@assay/bin/rspec:23:in  `<main>'
from /home/assay/.rvm/gems/ruby-2.1.2@assay/bin/rspec:23:in  `load'
from /home/assay/.rvm/gems/ruby-2.1.2@assay/gems/rspec-core-3.0.4/exe/rspec:4:in  `<top (required)>'
from /home/assay/.rvm/gems/ruby-2.1.2@assay/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in  `invoke'
from /home/assay/.rvm/gems/ruby-2.1.2@assay/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in  `run'

I am clearly doing something quite wrong. Any suggestions?

config/boot.rb

require 'rubygems'

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
port5432
  • 5,889
  • 10
  • 60
  • 97

1 Answers1

0

I found it here: Guard with RSpec on Rails 4 giving a lot of warnings

The solution is to delete the warnings line in the .rspec

The issue I see with this is that warnings in the application are now lost, because warnings in the gems are suppressed.

Community
  • 1
  • 1
port5432
  • 5,889
  • 10
  • 60
  • 97