theforeman/foreman — pull request #1576 by GregSutcliffe (2014-07-09 16:45:57+00:00)
Title: Fixes #6549 - Add :tests_to_skip to plugin registration block

This PR allows a plugin to do something like

```
Foreman::Plugin.register :foreman_discovery do
tests_to_skip "EncryptableTest" => ["this string IS encryptable and NOT decryptable"],
"HostTest" => ["should not save without a hostname"]
end

This is detected where `test` (which is aliased against `it` later in the test_helper) is defined - we jump in and monkeypatch MiniTest to check if this is a prohibited test class+name. If it is, we just define the test as a skip.

This is somewhat hacky - the two downsides are 1) monkey_patching MiniTest and 2) it only works for the newer `test "foo" ... end` style tests, `def test_foo ... end` can't be caught this way.

Feedback welcome - as I'm out of ideas as to how to do it better :)