RSpec随机种子非随机

时间:2019-01-31 01:57:09

标签: ruby-on-rails ruby random rspec seed

在最后一两天,即使我未指定种子,我对同一测试文件的所有运行都使用相同的随机种子。

    [jim@X230|apoxeia (bootstrap_4_from_responsive_sign_on_and_attornies_clients)]$ bin/rspec spec/system/change_requests_spec.rb  
Running via Spring preloader in process 2564 Environment is test

    Randomized with seed 41303

    ./spec/system/change_requests_spec.rb: Capybara starting Puma...
    * Version 3.12.0 , codename: Llamas in Pajamas
    * Min threads: 0, max threads: 4
    * Listening on tcp://127.0.0.1:36589 .....

    Top 5 slowest examples (51.21 seconds, 100.0% of total time):   Change Requests GET /change_requests displays the user who logged the change when logged in as admin
        17.91 seconds ./spec/system/change_requests_spec.rb:155   Change Requests GET /change_requests does NOT add a Change Request when logged in, and field is blank
        17.28 seconds ./spec/system/change_requests_spec.rb:39   Change Requests GET /change_requests adds a Change Request when logged in and valid params are given
        12.35 seconds ./spec/system/change_requests_spec.rb:106   Change Requests GET /change_requests displays when logged in
        3.37 seconds ./spec/system/change_requests_spec.rb:23   Change Requests GET /change_requests redirects when not logged in
        0.30664 seconds ./spec/system/change_requests_spec.rb:17

    Finished in 51.22 seconds (files took 0.45157 seconds to load) 5 examples, 0 failures

    Randomized with seed 41303

    Coverage report generated for RSpec to /home/jim/development/apps/apoxeia/coverage. 322 / 1933 LOC (16.66%) covered.

关于为什么会发生这种情况或应该从哪里开始的任何想法?

谢谢。

0 个答案:

没有答案