Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

minitest_plugin.rb:9 getting wrong number of arguments

~/Sites/sample_app$ rails test
Running via Spring preloader in process 24338
Run options: --seed 58780

Running:

..

Finished in 0.292172s, 6.8453 runs/s, 6.8453 assertions/s.
/var/lib/gems/2.3.0/gems/railties-5.1.0/lib/rails/test_unit/minitest_plugin.rb:9:in `aggregated_results': wrong number of arguments (given 1, expected 0) (ArgumentError)

I don't understand why I am getting this error. I Can't seem to find anyone with this specific error. I'm following the tutorial https://www.railstutorial.org/book/static_pages. This error follows the rails test command. Running Ubuntu and rails 5.1 if that helps. I'm not passing any arguments so I don't understand why I am getting this error.

My test file looks like :

    require 'test_helper'

    class StaticPagesControllerTest < ActionDispatch::IntegrationTest

    test "should get home" do
      get static_pages_home_url
      assert_response :success
    end

    test "should get help" do
      get static_pages_help_url
      assert_response :success
    end
like image 442
Josh HUmphrey Avatar asked May 10 '17 07:05

Josh HUmphrey


1 Answers

It turns out that in my test/test_helper.rb I needed a line of code that was missing. I added this before "class ActiveSupport::TestCase".

    Minitest::Reporters.use!

This gave me a passing result for my test with no strange argument error. Hope this helps someone for the future!

like image 101
Josh HUmphrey Avatar answered Sep 18 '22 17:09

Josh HUmphrey