問題タブ [rake-test]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ruby-on-rails - Rails テスト: RuntimeError: フリーズした文字列を変更できません
Rails プロジェクトに最初のテストを追加しようとしていますが、理解できないエラーが発生します。
ブラウザーからはすべて正常に動作します (記事を作成できます) が、テストで次のエラーが発生します。
テスト:
ランニング:
コントローラーの関連部分は次のとおりです。
これらはモデルの関連部分であると思います:
理由についてのアイデアはありますか?
または、これをデバッグする方法に関する提案はありますか?
ruby-on-rails - テスト actionview がレーキを中止しました。レーキの中止を回避するには?
Ruby on Rails への貢献 — Ruby on Rails ガイドを読みました
4-2-stable での rails/rails の
テストについて
: Ruby on Rails
(コミット番号: e531c86e6bb0b623cd18c97a7a32ba981e8fb2ce)
rails/activerecord directory
私のMacに。
% RUBYOPT=-W0 bundle exec rake test --trace
私は得たrake aborted!
レーキの中止を回避するには?
** test を呼び出す (first_time) ** test:template を呼び出す (first_time) ** test:template を実行する:template /Users/shingo/.rvm/rubies/ruby-2.2.3/bin/ruby -w -I"lib:test" -I"/Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0" "/Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2. 0/rake/rake_test_loader.rb" "test/template/active_model_helper_test.rb" "test/template/asset_tag_helper_test.rb" "test/template/atom_feed_helper_test.rb" "test/template/capture_helper_test.rb" "test/template/compiled_templates_test .rb" "test/template/date_helper_i18n_test.rb" "test/template/date_helper_test.rb" "test/template/dependency_tracker_test.rb" "test/template/digestor_test.rb" "test/template/erb/form_for_test.rb" "test/template/erb/tag_helper_test.rb" "test/template/erb_util_test.rb" "test/template/form_collections_helper_test.rb" "test/template/form_helper_test.rb" "test/template/form_options_helper_i18n_test.rb" "test/template /form_options_helper_test.rb" "test/template/form_tag_helper_test.rb" "test/template/html_test.rb" "test/template/javascript_helper_test.rb" "test/template/log_subscriber_test.rb" "test/template/lookup_context_test.rb" "test/template/number_helper_test.rb" "test/template/output_safety_helper_test.rb" "test/template/partial_iteration_test.rb" "test/template/record_identifier_test.rb" "test/template/record_tag_helper_test.rb" "test/template/render_test.rb" "test/template/resolver_patterns_test.rb" "test/template/sanitize_helper_test.rb" "test/template/streaming_render_test.rb" "test/template/tag_helper_test.rb" "test/template/template_error_test .rb" "test/template/template_test.rb" "test/template/test_case_test.rb" "test/template/test_test.rb" "test/template/testing/fixture_resolver_test.rb" "test/template/testing/null_resolver_test. rb" "test/template/text_helper_test.rb" "test/template/text_test.rb" "test/template/translation_helper_test.rb" "test/template/url_helper_test.rb" 実行オプション: --seed 32409test/template/sanitize_helper_test.rb" "test/template/streaming_render_test.rb" "test/template/tag_helper_test.rb" "test/template/template_error_test.rb" "test/template/template_test.rb" "test/template/test_case_test" .rb" "test/template/test_test.rb" "test/template/testing/fixture_resolver_test.rb" "test/template/testing/null_resolver_test.rb" "test/template/text_helper_test.rb" "test/template/text_test. rb" "test/template/translation_helper_test.rb" "test/template/url_helper_test.rb" 実行オプション: --seed 32409test/template/sanitize_helper_test.rb" "test/template/streaming_render_test.rb" "test/template/tag_helper_test.rb" "test/template/template_error_test.rb" "test/template/template_test.rb" "test/template/test_case_test" .rb" "test/template/test_test.rb" "test/template/testing/fixture_resolver_test.rb" "test/template/testing/null_resolver_test.rb" "test/template/text_helper_test.rb" "test/template/text_test. rb" "test/template/translation_helper_test.rb" "test/template/url_helper_test.rb" 実行オプション: --seed 32409rb" "test/template/test_case_test.rb" "test/template/test_test.rb" "test/template/testing/fixture_resolver_test.rb" "test/template/testing/null_resolver_test.rb" "test/template/text_helper_test.rb" " "test/template/text_test.rb" "test/template/translation_helper_test.rb" "test/template/url_helper_test.rb" 実行オプション: --seed 32409rb" "test/template/test_case_test.rb" "test/template/test_test.rb" "test/template/testing/fixture_resolver_test.rb" "test/template/testing/null_resolver_test.rb" "test/template/text_helper_test.rb" " "test/template/text_test.rb" "test/template/translation_helper_test.rb" "test/template/url_helper_test.rb" 実行オプション: --seed 32409
ランニング:
................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ....S................................................. ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ............................................................................. ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ……................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ..................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ................................................................... ..................................................................... ................................................................... ................................................................... ................................................................... ...................................................................................................................................... ................................................................... ................................................................... ................................................................... ...................................................................
11.824681 秒、132.4349 ラン/秒、301.3189 アサーション/秒で終了しました。
1566回の実行、3563回のアサーション、0回の失敗、0回のエラー、1回のスキップ
テストをスキップしました。詳細については、 --verbose を指定して実行してください。** test:integration:action_pack を呼び出す (first_time) ** test:integration:action_pack を実行する /Users/shingo/.rvm/rubies/ruby-2.2.3/bin/ruby -w -I"lib:test" -I" /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0" "/Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake /rake_test_loader.rb" "test/actionpack/abstract/abstract_controller_test.rb" "test/actionpack/abstract/helper_test.rb" "test/actionpack/abstract/layouts_test.rb" "test/actionpack/abstract/render_test.rb" " test/actionpack/controller/capture_test.rb" "test/actionpack/controller/layout_test.rb" "test/actionpack/controller/render_test.rb" "test/actionpack/controller/view_paths_test.rb" 実行オプション:
ランニング:
................................................................... ................................................................... ................フ................................. ................................................................... ...................................
0.799071 秒、275.3197 ラン/秒、384.1961 アサーション/秒で終了しました。
1) 失敗: RenderTest#test_locals_option_to_assert_template_is_not_supported [/Users/shingo/Documents/workout/rails/actionview/test/actionpack/controller/render_test.rb:1267]: --- 予想 +++ 実際 @@ -1,2 +1 @@ -" #assert_template への :locals オプションは、ActionView::TestCase でのみサポートされています -" +""
220回の実行、307回のアサーション、1回の失敗、0回のエラー、0回のスキップレーキが中止されました! コマンドはステータス (1) で失敗しました: [ruby -w -I"lib:test" -I"/Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0" "/Users/ shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/rake_test_loader.rb" "test/actionpack/abstract/abstract_controller_test.rb" "test/actionpack/abstract/helper_test.rb" " test/actionpack/abstract/layouts_test.rb" "test/actionpack/abstract/render_test.rb" "test/actionpack/controller/capture_test.rb" "test/actionpack/controller/layout_test.rb" "test/actionpack/controller/ render_test.rb" "test/actionpack/controller/view_paths_test.rb" ] /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/testtask.rb:108:
block (3 levels) in define' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils.rb:57:in
sh' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils_ext.rb:37:in
sh' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils.rb:96:inruby' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils_ext.rb:37:in
ruby' /Users/shingo/.rvm/rubies/ruby-2.2 .3/lib/ruby/2.2.0/rake/testtask.rb:104:inblock (2 levels) in define' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils_ext.rb:58:in
verbose' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/testtask. rb:100:inblock in define' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:240:in
call' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:240:inblock in execute' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:235:in
each' /Users/shingo/.rvm/ rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:235:execute' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:179:in
invoke_with_call_chain のブロック内' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2 .0/monitor.rb:211:inmon_synchronize' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:172:in
invoke_with_call_chain' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:201:inblock in invoke_prerequisites' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:199:in
each' /Users/ shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:199:ininvoke_prerequisites' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:178:in
ブロック in invoke_with_call_chain' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/monitor.rb:211:inmon_synchronize' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:172:in
invoke_with_call_chain' /Users/shingo/.rvm/rubies/ruby-2.2 .3/lib/ruby/2.2.0/rake/task.rb:165:ininvoke' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:150:in
invoke_task' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application. rb:106:inblock (2 levels) in top_level' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:106:in
each' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:106:inblock in top_level' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:115:in
run_with_threads' /Users/shingo/.rvm/ rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:100:intop_level' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:78:in
block in run' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2 .0/rake/application.rb:176:standard_exception_handling' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:75:in
実行中' /Users/shingo/.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/ rake:33:in<top (required)>' /Users/shingo/.rvm/gems/ruby-2.2.3/bin/rake:23:in
load' /Users/shingo/.rvm/gems/ruby-2.2.3/bin/rake:23:の<main>' /Users/shingo/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in
eval' /Users/shingo/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `' タスク: TOP => test => test:integration:action_pack
ruby-on-rails - rake テスト出力の win32console メッセージを修正するには?
現在、 Windows 10で Ruby on Rails を学習しようとしています。
Michael Hartl による優れた railstutorial に従っています。
ただし、実行時に表示される「gem install win32console」メッセージ (および色の欠如) に悩まされていますrake test
。どうすればこれを修正できますか?
出力例:
私のセットアップ:
ベース: Ruby 2.2 Rails Installer for Windows . Git Bash
を使用してコマンドを実行します。minitest-reporters gem
もインストールしました (チュートリアルのステップ 3.7.1 )。
私が試したこと:
最初に
gem install win32console
bu を実行しましたが、実行すると宝石が表示されますが、これは効果がありませんでしたgem list
。次に、win32console が非推奨になったので、 ansiconをインストールしました。
これも効果がありませんでした。とにかく、色はWindows 10でサポートされているようです。たとえば、このブログにあるHello Worldの例
を実行すると、ansicon がインストールされているかどうかに関係なく、青と赤のテキストが表示されます。 ただし、出力に色が正しく表示されず、それでも警告が表示されます。puts "\e[34mHello \e[31mWorld\e[0m"
rake test
ruby - spec/features/abc_spec.rb 'header details'の下でRubyで単一のテストを実行する方法はありますか?
spec/features/abc_spec.rb 'header details' の下で ruby で単一のテストを実行する方法はありますか? 元:
ruby - レーキ テストの ruby / sinatra を実行しようとしていますが、レーキが中止されたと表示されます。どうすればいいのかわからない
これが私の端末が私に見せているものです..