https://github.com/mitchellh/minitest-speed
Proof of concept speed tests using minitest.
https://github.com/mitchellh/minitest-speed
Last synced: about 1 year ago
JSON representation
Proof of concept speed tests using minitest.
- Host: GitHub
- URL: https://github.com/mitchellh/minitest-speed
- Owner: mitchellh
- Created: 2011-09-15T21:12:11.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-09-15T21:12:21.000Z (almost 15 years ago)
- Last Synced: 2025-04-10T05:59:26.146Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 89.8 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minitest-speed
This is an extension to [minitest](https://github.com/seattlerb/minitest)
which adds speed tests to the mix. Speed tests are simply methods which are
timed, and their timing date is outputted. If this timing data is saved somewhere,
it can be graphed later and viewed.
**WARNING:** This is a _proof of concept_. It works, but is not intended --
in its current form -- to be used for production tests.
## Example
### Defining And Using a Speed Test
Define a test class:
```ruby
require "minitest/autorun"
require "minitest/speed"
class MyTest < MiniTest::Speed::TestCase
def test_speed_of_hash_creation
Hash.new
end
end
```
Run them:
$ SPEED=1 ruby my_test.rb
Started
test_speed_of_hash_creation: 0.000000 0.000000 0.000000 ( 0.000019)
Finished in 0.000753 seconds.
1 tests, 0 assertions, 0 failures, 0 errors, 0 skips
With `SPEED` set, only the speed tests are run, and their output is easily visible.
If `SPEED` is not set, then only non-speed tests are run.