elixir-lang/elixir — pull request #1749 by seejee (2013-10-06 19:12:55+00:00)
Title: Implemented ability to skip individual unit tests.

Hi! Thanks for the wonderful work on elixir!

I am *very* new to elixir, and as I was working through the elixir examples on [exercism.io](http://exercism.io/), I realized that there was no built-in way to skip individual `ex_unit` tests. I figured it would be a fun feature to try and add to elixir. I decided to take this on primarily to learn about the language and codebase, so **please be brutal** about both my approach and my implementation. I'm ready to learn!

In short, this PR adds the ability to skip an individual unit test by prefixing it with `skip_`. The following test now exists in the ex_unit test suite:

skip_test "this test is skipped" do
raise "This should never be executed."
end

And it will result in the following output when tests are run:

![Skipped test console output](https://www.evernote.com/shard/s286/sh/70811928-c55f-42cb-8f62-1e6e5bfc802d/ce752518cf8b1a0ee0794351a6c64ee8/deep/0/1.%20Thanks%20for%20flying%20Vim%20(bash)

Here's what I don't like about my approach:

* I don't like that a skipped test results in the `setup` and `teardown` callbacks being executed around the test, but I think removing that would require a lot more infrastructure in the runner to keep track of "real" tests and skipped tests differently.

* I feel like there's probably a pattern-matchy way to determine whether to respond with `:test_skipped` or `:test_finished`, but I resorted to explicit checks to make that determination.

Again, thanks for everything! Regardless of the outcome of this PR, I had a lot of fun digging into the `ExUnit` codebase, and I can't wait to do more elixir in the future!