Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jorgenpt/test-unit-fasterskip
Add class-level pend & omit_if/unless that skip setup/teardown.
https://github.com/jorgenpt/test-unit-fasterskip
Last synced: 22 days ago
JSON representation
Add class-level pend & omit_if/unless that skip setup/teardown.
- Host: GitHub
- URL: https://github.com/jorgenpt/test-unit-fasterskip
- Owner: jorgenpt
- Created: 2012-02-06T21:37:24.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-03-14T22:14:53.000Z (almost 13 years ago)
- Last Synced: 2024-10-03T12:34:27.455Z (3 months ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/test-unit-fasterskip
- Size: 97.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Test::Unit::FasterSkip
======================This gem allows you to skip setup/teardown for tests that are omitted/pending.
If your setup method is very heavy-weight, this can save you a lot of time!To use FasterSkip, just change this:
```ruby
class MyTestCase < Test::Unit::TestCase
def test_cool_feature
pend('Bug #159: To be implemented.')
# TODO: Figure out how to test this.
enddef test_platform_specific_feature
omit_if(File::ALT_SEPARATOR, "Skipping test on Windows/VMS")
# ...
end
end
```To this:
```ruby
require 'test-unit-fasterskip'
class MyTestCase < Test::Unit::TestCase
pend('Bug #159: To be implemented.')
def test_cool_feature
# TODO: Figure out how to test this.
endomit_if("Skipping test on Windows/VMS") { File::ALT_SEPARATOR }
def test_platform_specific_feature
# ...
end
end
```Note that neither `setup` *nor* `teardown` will be run in these scenarios. You
can also call `omit_unless`, which negates the value of the boolean returned by
your block. Your `omit_if` block will be passed the current TestCase instance as
its first argument.