[#29911] [Bug #3231] Digest Does Not Build — Charlie Savage <redmine@...>

Bug #3231: Digest Does Not Build

19 messages 2010/05/01

[#29920] [Feature #3232] Loops (while/until) should return last statement value if any, like if/unless — Benoit Daloze <redmine@...>

Feature #3232: Loops (while/until) should return last statement value if any, like if/unless

9 messages 2010/05/01

[#29997] years in Time.utc — Xavier Noria <fxn@...>

Does anyone have a precise statement about the years supported by

13 messages 2010/05/04

[#30010] [Bug #3248] extension 'tk' is finding tclConfig.sh and tkConfig.sh incorrectly — Luis Lavena <redmine@...>

Bug #3248: extension 'tk' is finding tclConfig.sh and tkConfig.sh incorrectly

9 messages 2010/05/05

[#30226] [Bug #3288] Segmentation fault - activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88 — Szymon Jeż <redmine@...>

Bug #3288: Segmentation fault - activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88

10 messages 2010/05/13

[#30358] tk doesn't startup well in doze — Roger Pack <rogerdpack2@...>

Currently with 1.9.x and tk 8.5,the following occurs

12 messages 2010/05/22

[ruby-core:29910] Re: [Backport #3219] assert now passes non-boolean result

From: Eric Hodel <drbrain@...7.net>
Date: 2010-05-01 05:30:19 UTC
List: ruby-core #29910
On Apr 29, 2010, at 09:12, caleb clausen wrote:

> Issue #3219 has been updated by caleb clausen.
> 
> It is all too easy to write assert(foo, bar) when you meant to write assert_equal(foo, bar). I have made the same mistake myself a number of times. Usually, no error will result because assert allows an optional second parameter (an alternate String to be printed when the assertion fails). 

I don't see how you could have this problem if you're following a red, green, refactor type discipline.  If the test passed when you forgot to add _equal you should immediately know you did it wrong because it should have failed.  How can you trust any of your tests if you haven't ensured they fail when something is wrong?

> I'd suggest that a better way to detect this problem is for assert to fail if a non-String is passed as the second parameter. This won't detect all cases of using assert when you meant assert_equal, but it should catch at lest 90%.

Why should I have to call #to_s manually when I can pass an object that will print something useful for me?

$ cat t.rb 
require 'minitest/autorun'

class TestAssert < MiniTest::Unit::TestCase

  def test_assert
    o = Object.new
    def o.to_s() "something useful" end

    assert false, o
  end

end
$ ruby19 t.rb 
Loaded suite t
Started
F
Finished in 0.000645 seconds.

  1) Failure:
test_assert(TestAssert) [t.rb:9]:
something useful

1 tests, 1 assertions, 1 failures, 0 errors, 0 skips

Test run options: --seed 42229


In This Thread