93

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

Lee McAlilly
  • 9,084
  • 12
  • 60
  • 94

3 Answers3

154

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

Dave Powers
  • 2,051
  • 2
  • 30
  • 34
phinze
  • 2,297
  • 1
  • 15
  • 8
  • 4
    Here is a current link to the documentation: http://ruby-doc.org/stdlib-2.1.5/libdoc/minitest/rdoc/MiniTest/Assertions.html#method-i-skip – Gregor Schmidt Dec 03 '14 at 13:05
11

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

Dave Powers
  • 2,051
  • 2
  • 30
  • 34
Lee McAlilly
  • 9,084
  • 12
  • 60
  • 94
7

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

Spakman
  • 101
  • 1
  • 3