Is it possible to mark a test as pending in MiniTest?

Ruby on-RailsTestingMinitest

Ruby on-Rails Problem Overview


And if this is possible, what is the syntax for this?

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

It took me a few minutes poking around on the RubyDocs to figure out the actual syntax for pulling this off. Figured I'd toss it here to save some future person a few clicks.

From inside your test, simply call the skip() method, like so:

skip("reason for skipping the test")

The method is MiniTest::Assertions#skip - http://docs.seattlerb.org/minitest/Minitest/Assertions.html#method-i-skip

Solution 2 - Ruby on-Rails

I figured this out. With minitest you don't mark tests as pending. But you can skip them:

http://docs.seattlerb.org/minitest/Minitest/Assertions.html#method-i-skip

Solution 3 - Ruby on-Rails

Also, when using MiniTest::Spec, if you don't pass a block to it(), the test is marked as skipped.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLee McAlillyView Question on Stackoverflow
Solution 1 - Ruby on-RailsphinzeView Answer on Stackoverflow
Solution 2 - Ruby on-RailsLee McAlillyView Answer on Stackoverflow
Solution 3 - Ruby on-RailsSpakmanView Answer on Stackoverflow