Issue #4368 has been updated by Deryl Doucette.


We tested this against the following: 1.9.2 patch levels p136, p180, and p188 (revisions 30365, 30909, and 31204).

We came up with the same errors as shown by the following:

=== TEST FILE CONTENTS


  require 'test/unit'
  class TestingTest < Test::Unit::TestCase
    def test_omg
      assert_block("SEEING THE ACTUAL MESSAGE") { false }
    end
  end


=== TEST OUTPUT

  pgpmbp:tmp pgpkeys$ ruby brain.rb 
  Loaded suite brain
  Started
  F
  Finished in 0.000365 seconds.

    1) Failure:
  test_omg(TestingTest) [brain.rb:5]:
  Expected block to return true value.

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

  Test run options: --seed 8967



NOTE
----
The first revision to show correctly was revision 29036 (p0). Revision 30365 showed it correctly as well (p136). 
So to summarize:

  pgpmbp:tmp pgpkeys$ rvm use 1.9.2-p0
  Using /Users/pgpkeys/.rvm/gems/ruby-1.9.2-p0
  pgpmbp:tmp pgpkeys$ ruby brain.rb 
  Loaded suite brain
  Started
  F
  Finished in 0.000618 seconds.

    1) Failure:
  test_omg(TestingTest) [brain.rb:5]:
  SEEING THE ACTUAL MESSAGE.
  Expected block to return true value.

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

  Test run options: --seed 38217
  pgpmbp:tmp pgpkeys$ rvm use 1.9.2-p136
  Using /Users/pgpkeys/.rvm/gems/ruby-1.9.2-p136
  pgpmbp:tmp pgpkeys$ ruby brain.rb 
  Loaded suite brain
  Started
  F
  Finished in 0.000395 seconds.

    1) Failure:
  test_omg(TestingTest) [brain.rb:5]:
  SEEING THE ACTUAL MESSAGE.
  Expected block to return true value.

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

  Test run options: --seed 58527
  pgpmbp:tmp pgpkeys$ rvm use 1.9.2-p180
  Using /Users/pgpkeys/.rvm/gems/ruby-1.9.2-p180
  pgpmbp:tmp pgpkeys$ ruby brain.rb 
  Loaded suite brain
  Started
  F
  Finished in 0.000374 seconds.

    1) Failure:
  test_omg(TestingTest) [brain.rb:5]:
  Expected block to return true value.

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

  Test run options: --seed 62205
  pgpmbp:tmp pgpkeys$ rvm use 1.9.2-p188

  pgpmbp:tmp pgpkeys$ ruby brain.rb 
  Loaded suite brain
  Started
  F
  Finished in 0.000616 seconds.

    1) Failure:
  test_omg(TestingTest) [brain.rb:5]:
  Expected block to return true value.

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

  Test run options: --seed 34294


=== NOTE TO DEVS

So, p0 and p136 act almost correctly, but they display both the specified error message as well as the default error message. p188 or an earlier point release between p136 and p188 introduces an regression which reverts this behaviour to only showing the default error message.

It would be more appropriate if it displayed the custom error message only.
----------------------------------------
Bug #4368: MiniTest::Assertions#assert_block ignores the given message.
http://redmine.ruby-lang.org/issues/4368

Author: Nobuyoshi Nakada
Status: Closed
Priority: Normal
Assignee: Ryan Davis
Category: lib
Target version: 1.9.2
ruby -v: r30784


 This method ignores the argument.
 
     def assert_block msg = nil
       assert yield, "Expected block to return true value."
     end


-- 
http://redmine.ruby-lang.org