rake icon indicating copy to clipboard operation
rake copied to clipboard

Verbose console

Open kaiquekandykoga opened this issue 3 years ago • 0 comments

This is an attempt to fix the issue https://github.com/ruby/rake/issues/392.

It makes verbose option works when passing -v and --verbose options.

The tests are being done with a simple Rakefile.

require 'rake/testtask'

Rake::TestTask.new('a') do |t|
  t.libs << 'test'
  t.test_files = FileList['test/**/test_*.rb']
end

task default: :a

And a simple test test/test_a.rb.

require 'test/unit'

class TestA < Test::Unit::TestCase
  def test_a
    assert_equal true, true
  end
end

After.

rake -v

rake --verbose

Started
TestA:
  test_a:                                                                                                                                                       .: (0.000229)

Finished in 0.000591 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1692.05 tests/s, 1692.05 assertions/s

Rakefile with verbose true works.

require 'rake/testtask'

Rake::TestTask.new('a') do |t|
  t.libs << 'test'
  t.verbose = true
  t.test_files = FileList['test/**/test_*.rb']
end

task default: :a

Rakefile with options -v works.

require 'rake/testtask'

Rake::TestTask.new('a') do |t|
  t.libs << 'test'
  t.options = '-v'
  t.test_files = FileList['test/**/test_*.rb']
end

task default: :a

Rakefile with options --verbose works.

require 'rake/testtask'

Rake::TestTask.new('a') do |t|
  t.libs << 'test'
  t.options = '--verbose'
  t.test_files = FileList['test/**/test_*.rb']
end

task default: :a

Without passing the verbose options mentioned above works as expected with dots only.

Started
.
Finished in 0.000564 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1773.05 tests/s, 1773.05 assertions/s

Before.

Using the master branch displays a message if --verbose is used.

Use TESTOPTS="--verbose" to pass --verbose, etc. to runners.

It was removed because the solution is setting this variable.

kaiquekandykoga avatar Oct 27 '21 19:10 kaiquekandykoga