私はちょうど新しいプロジェクトに追いついてしまい、rake test
は多くのばかげた出力を生成します。それはなぜですか?私は知らないすべての宝石を取り除こうとしましたが、依然として私の生産は濁っています。私はbundle exec rake test
でテストスイートを呼びます。私のレールテストは不器用な出力を生成します
サンプル出力 - この種のものです。
/Users/hendricius/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.22.5/lib/active_support/file_update_checker.rb:98: warning: File.exists? is a deprecated name,
use File.exist? instead
/Users/hendricius/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.22.5/lib/active_support/file_update_checker.rb:98: warning: File.exists? is a deprecated name,
use File.exist? instead
/Users/hendricius/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.22.5/lib/active_support/file_update_checker.rb:98: warning: File.exists? is a deprecated name,
use File.exist? instead
/Users/hendricius/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.22.5/lib/active_support/file_update_checker.rb:98: warning: File.exists? is a deprecated name,
use File.exist? instead
.ruby-version
ファイルからRubyのバージョンが2.2.2
です。インストールされているレールのバージョンは3.2.22.5
です。
私のテストの宝石は、次のとおりです。
group :test, :development do
# gem 'rack-mini-profiler'
# gem 'minitest'
gem 'minitest-rails'
gem 'test-unit'
gem 'shoulda'
gem 'shoulda-matchers'
gem 'fabrication'
gem 'byebug'
end
私はその後、私のRakefile
をダブルチェック。私が想像できる
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
WooWoop::Application.load_tasks
task default: [:test]
唯一の他の事は私のtest_helper
次のようになります。これは、次の内容を持っています。私は以下の内容を貼り付けました。それはよさそうだ。
ENV["RAILS_ENV"] = "test"
require File.expand_path("../../config/environment", __FILE__)
require "rails/test_help"
require "minitest/rails"
require "minitest/pride"
require 'shoulda'
require 'shoulda/matchers'
# $VERBOSE=nil
# ActiveRecord::Migration.check_pending!
ActiveSupport::TestCase.test_order = :random
# Protractor test or even some dirty debugging in the rails console on test environment
# might have left some garbage on the DB. Lets make sure we start with a clean state.
# parses the response and returns it.
私はRUBYOPT=W0 TEST=test/unit/shop_test.rb be rake test
を使用している場合、私は出力を沈黙することができます唯一の方法です。レール3を使用しているので、それは唯一の方法ですか?
更新:
私は今、私はまだ私が前に見たことのない不思議な警告の多くを得る2.0.0
をルビーにダウングレードしてみました。
/Users/hendricius/.rbenv/versions/2.0.0-p648/lib/ruby/gems/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:89: warning: instance variable @mount_on not in
itialized
/Users/hendricius/.rbenv/versions/2.0.0-p648/lib/ruby/gems/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:243: warning: instance variable @previous_model_for_showcase_cov
er_picture not initialized
/Users/hendricius/.rbenv/versions/2.0.0-p648/lib/ruby/gems/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:89: warning: instance variable @mount_on not in
itialized
/Users/hendricius/.rbenv/versions/2.0.0-p648/lib/ruby/gems/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:243: warning: instance variable @previous_model_for_manager_pict
ure not initialized
(eval):11: warning: instance variable @opening_hours_monday_from not initialized
(eval):2: warning: instance variable @opening_hours_monday_to not initialized
(eval):11: warning: instance variable @opening_hours_tuesday_from not initialized
(eval):2: warning: instance variable @opening_hours_tuesday_to not initialized
(eval):11: warning: instance variable @opening_hours_wednesday_from not initialized
(eval):2: warning: instance variable @opening_hours_wednesday_to not initialized
(eval):11: warning: instance variable @opening_hours_thursday_from not initialized
(eval):2: warning: instance variable @opening_hours_thursday_to not initialized
(eval):11: warning: instance variable @opening_hours_friday_from not initialized
(eval):2: warning: instance variable @opening_hours_friday_to not initialized
(eval):11: warning: instance variable @opening_hours_saturday_from not initialized
(eval):2: warning: instance variable @opening_hours_saturday_to not initialized
編集:
私は最終的にすべての警告はなくなっている4.レールにアップグレード終わりました。
以前に使用したRubyのバージョンはどれですか?なぜ元のプロジェクトと同じバージョンを使用していないのですか?あなたが作成する必要があるよりも自分自身のために多くのトラブルを作成しないでください。 – Casper
これは '2.0.0-p481'でした。私はそのショットを与えるでしょう。 – Hendrik
私はなぜアップグレードしたのか覚えています: '警告:ruby-2.0.0-p481は寿命を過ぎ、現在はサポートされていません。 それはもはやバグフィックスや重大なセキュリティアップデートを受け取ることはありません。 ' – Hendrik