Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verbose console #394

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kaiquekandykoga
Copy link

@kaiquekandykoga kaiquekandykoga commented Oct 27, 2021

This is an attempt to fix the issue #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant