问题摘要:
当在bash终端上运行"rails test“命令时,它打印出一个非常长的列表(几千行内容),这使得查找错误变得困难(因为它位于顶部)。
我尝试过的:
我试过"rails test --help“,看看有没有什么命令可以禁用这么长的打印,但是没有用。
系统信息:
Ubuntu 20.04
ruby=3.0.0
rails=6.1.3
gem=3.2.3
yarn=1.22.10
问题输出:
jhunhong@msipc:~/RailsProject/sample_app (static-pages)$ rails test
Running via Spring preloader in process 154409
Started with run options --seed 20098
ERROR["test_should_get_about", #<Minitest::Reporters::Suite:0x00007f956800e858 @name="StaticPagesControllerTest">, 0.06735827699594665]
test_should_get_about#StaticPagesControllerTest (0.07s)
NameError: NameError: undefined local variable or method `static_pages_about__url' for #<StaticPagesControllerTest:0x000055f376974e78 @_routes=nil, @NAME="test_should_get_about", @failures=[#<Minitest::UnexpectedError: Unexpected exception>], @assertions=0, @integration_session=#<#<Class:0x000055f376974888>:0x000055f376974220 @_routes=nil, @app=#<SampleApp::Application:0x000055f3741a9290 @_all_autoload_paths=["/home/jhunhong/RailsProject/sample_app/app/channels", "/home/jhunhong/RailsProject/sample_app/app/controllers", "/home/jhunhong/RailsProject/sample_app/app/controllers/concerns", "/home/jhunhong/RailsProject发布于 2021-03-12 13:50:54
您可以添加-f或--fail-fast选项,即rails test -f。
它会在第一个测试失败时停止运行测试。
https://stackoverflow.com/questions/66593801
复制相似问题