2

自動テストは更新で壊れましrspec-rails 2.2.1た。にロールバックした後でも、再び機能させることはできませんrspec-rais 2.2.0

私が見つけることができる唯一の情報は、「アプリ:テストを実行できませんでした」という唸り声のポップアップです。には何も書き込まれていませんlog/test.log

これはコンソールに出力されます:

/Users/meltemi/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit test/test_helper.rb].each { |f| require f }" | unit_diff -u
Loaded suite -e
Started

Finished in 0.003428 seconds.


0 tests, 0 assertions, 0 failures, 0 errors, 0 skips

Test run options: --seed 38767

これのトラブルシューティングをどこから始めればよいか考えてみてください。調べてみautotest.logたら…見つけたら!?!

編集:で自動テストを実行してみて、コンソールに「一致するテストがありません...autotest -v 」のリストを取得しました(以下の20±の例):

...
No tests matched .git/objects/fe/41f5cc24d667635c46a533fd09bf7bb514e032
No tests matched .git/objects/fe/4577696b2811818fe7439990be0d2f65a892c5
No tests matched .git/objects/fe/e16b09c5e782035a347ed9b257ff9b2b3fa173
No tests matched .git/refs/heads/MenuModel
No tests matched .git/refs/heads/master
No tests matched .git/refs/remotes/origin/master
No tests matched .git/refs/tags/v0.0.1
No tests matched .git/refs/tags/v0.0.1.1
No tests matched .gitignore
No tests matched .rspec
No tests matched Capfile
No tests matched Gemfile
No tests matched Gemfile.lock
No tests matched README
No tests matched Rakefile
No tests matched app/helpers/application_helper.rb
No tests matched autotest/discover.rb
No tests matched config/application.rb
No tests matched config/boot.rb
No tests matched config/database.yml
No tests matched config/deploy.rb
No tests matched config/environment.rb
...

これが設定(~/.autotest)です:

# ~/.autotest
# Include plugins
require 'autotest/fsevent'
require 'autotest/growl'

# ./.autotest
# exceptions (files to ignore) 
# mappings (which files to specifically monitor for changes)
Autotest.add_hook(:initialize) {|at|
  at.add_exception %r{^\.git}  # ignore Version Control System
  at.add_exception %r{^./tmp}  # ignore temp files, lest autotest will run again, and again...
  #  at.clear_mappings         # take out the default (test/test*rb)
  at.add_mapping(%r{^lib/.*\.rb$}) {|f, _|
    Dir['spec/**/*.rb']
  }
  nil
}
4

1 に答える 1

4

autotest -s rspec2自動テストに「rspec2」スタイルを使用するように指示します。これにより、スペックファイルを検索し、その中の例を実行します。

ただし、これは単なる回避策です。自動テストは、プロジェクトのエントリに基づいて仕様を検出することになっています./autotest/discover.rb。そして、あなたが見つけたように、最近のコード更新は自動発見を壊しました。私はこれに自分で遭遇し、ソースを追跡することができませんでした。

于 2010-12-07T16:57:31.110 に答える