Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

generated tests should flunk when unimplemented

#5692

when using the generators, eg

rails generate controller my_controller

test/unit tests are generated. These tests traditionally have contained something along the lines of

test "the truth" do
  assert true
end

I believe the correct situation should be for the tests by default to flunk. The emphasis should be on the developer to make them pass rather than starting with a complete suite of passing (but useless) tests.

I have attached a patch for consideration.

Matt

Reported by eightbitraptor · September 23rd, 2010 @ 05:12 PM

State: wontfix
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. eightbitraptor
  2. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to wontfix
    • Importance changed from to Low

    Thanks Matt! We've gone back one forth on fail-by-default and we keep coming back to keeping the new-user experience clean and understandable. A failing boolean is confusingly irrelevant.

    September 23rd, 2010 @ 05:43 PM

  3. eightbitraptor
    eightbitraptor

    Thanks for the feedback. I guess that makes sense however I would argue that a misleading pass would be more harmful than a more verbose rake output. It could give a false sense of confidence that generated code is already tested for example.

    Anyway. I'm assuming this has already been argued to death so i'll let this one die.

    Matt.

    September 23rd, 2010 @ 05:58 PM

  4. Andrew White
    Andrew White

    Why not use pending as a middle way?

    require 'test_helper'
    
    class PagesControllerTest < ActionController::TestCase
      test "pages controller" do
        pending "Replace this with your real tests"
      end
    end
    

    That way you don't get a backtrace and error message if you're lazy, just a single line acting as a reminder.

    October 18th, 2010 @ 12:12 PM