Skip to content
Proof of concept minitest extension to add test marking.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib/minitest
.gitignore
Gemfile
README.md
Rakefile
minitest-mark.gemspec

README.md

minitest-mark

This is an extension to minitest which adds the ability to use test marking. This feature is inspired by pytest's marks.

WARNING: This is a proof of concept. It works, but is not intended -- in its current form -- to be used for production tests.

Example

Defining And Running Marks

Define a test with some marks:

require "minitest/autorun"
require "minitest/unit"
require "minitest/mark"

class MyTest < MiniTest::Unit::TestCase
  mark("foo")
  def test_things
    assert true
  end

  mark("bar")
  def test_other
    assert true
  end
end

Run them like normal and they'll run, like normal:

$ ruby my_test.rb
Started
..
Finished in 0.000743 seconds.

2 tests, 2 assertions, 0 failures, 0 errors, 0 skips

Run with MARK environmental variable to target only select marks:

$ MARK=foo ruby my_test.rb
Started
.
Finished in 0.000533 seconds.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Something went wrong with that request. Please try again.