And if this is possible, what is the syntax for this?
Asked
Active
Viewed 2.0k times
3 Answers
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
-
4Here 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
-
2this link is not working anymore, can you add answer instead of link. – Anil Maurya Jul 17 '14 at 07:42
-
1phinze has the correct syntax in his answer. I changed the accepted answer to his. – Lee McAlilly Jul 23 '14 at 00:59
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