microtest
Version, currently 0.7.029 versions
- 1.2.9latestNov 16, 2025
- 1.2.8not indexedNov 16, 2025
- 1.2.7not indexedNov 16, 2025
- 1.2.6not indexedNov 16, 2025
- 1.2.5not indexedNov 16, 2025
- 1.2.4not indexedNov 16, 2025
- 1.2.3not indexedNov 16, 2025
- 1.2.2not indexedNov 16, 2025
- 1.2.1not indexedNov 16, 2025
- 1.2.0not indexedNov 16, 2025
- 1.1.1not indexedNov 16, 2025
- 1.1.0not indexedNov 16, 2025
- 1.0.0not indexedNov 16, 2025
- 0.9.0not indexedNov 16, 2025
- 0.8.0not indexedNov 16, 2025
- 0.7.0not indexedNov 16, 2025
- 0.6.0not indexedNov 16, 2025
- 0.5.0not indexedNov 16, 2025
- 0.4.3not indexedNov 16, 2025
- 0.4.2not indexedNov 16, 2025
- 0.4.1not indexedNov 16, 2025
- 0.4.0not indexedNov 16, 2025
- 0.3.2not indexedNov 16, 2025
- 0.3.1not indexedNov 16, 2025
- 0.3.0not indexedNov 16, 2025
- 0.2.0not indexedNov 16, 2025
- 0.1.2not indexedNov 16, 2025
- 0.1.1not indexedNov 16, 2025
- 0.1.0not indexedNov 16, 2025
github.com/Ragmaanir/microtest
Small test framework, because it has power asserts as the only assertion.
32 stars
0 dependents
License: MIT
Nothing has been indexed for 0.7.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
microtest:
github: Ragmaanir/microtest
version: ~> 0.7.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.7.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# 🔬 microtest [](https://github.com/Ragmaanir/microtest/actions/workflows/crystal.yml)
### Version 1.2.9
A small testing framework inspired by minitest/minitest.cr.
## Features
- This framework is opinionated
- It uses power asserts by default. There are no `assert_equals`, `assert_xyz`, just power asserts (except for `assert_raises`)
- It uses the spec syntax for test case structure (`describe`, `test`, `before`, `after`). Reasons: No test-case name-clashes when using describe. Not forgetting to call super in setup/teardown methods.
- No nesting of describe blocks. IMO nesting of those blocks is an anti-pattern.
- No let-definitions. Only before / after hooks. Use local variables mostly.
- Tests have to be started explicitly by `Microtest.run!`, no at-exit hook.
- Colorized and abbreviated exception stacktraces
- Randomized test order (SEED can be specified as environment variable)
- Focus individual tests (`test! "my test" do ...`)
- Different reportes (progress, descriptions, slow tests)
## Installation
Add this to your application's `shard.yml`:
```yaml
development_dependencies:
microtest:
github: ragmaanir/microtest
version: ~> 1.2.9
```
And add this to your `spec_helper.rb`:
```crystal
require "microtest"
include Microtest::DSL
Microtest.run!
```
## Usage
```crystal
class WaterPump
getter name : String
getter speed : Int32
getter? enabled : Bool = false
def initialize(@name, @speed = 10)
end
def enable
@enabled = true
end
end
describe WaterPump do
test "enabling" do
p = WaterPump.new("main")
p.enable
assert(p.enabled?)
end
test "pump speed" do
p = WaterPump.new("main", speed: 100)
assert(p.speed > 50)
end
test "this one is pending since it got no body"
pending "this one is pending even though it has a body" do
raise "should not raise"
end
end
```
Run the test with:
`crystal spec`
You can provide the seed to run the tests in the same order:
`SEED=123 crystal spec`
## Power Assert Output
```crystal
describe AssertionFailure do
test "assertion failure" do
a = 5
b = "aaaaaa"
assert "a" * a == b
end
end
```
Generates:

### Microtest Test Output (microtest tests using progress reporter)

## Reporters
Use common reporter combinations:
```crystal
# both versions include error-list-, slow-tests- and summary-reporters:
Microtest.run!(:progress)
Microtest.run!(:descriptions)
```
Or select the used reporters explicitly:
```crystal
Microtest.run!([
Microtest::DescriptionReporter.new,
Microtest::ErrorListReporter.new,
Microtest::SlowTestsReporter.new,
Microtest::SummaryReporter.new,
] of Microtest::Reporter)
```
```crystal
describe First do
test "success" do
end
test "skip this"
end
describe Second do
def raise_an_error
raise "Oh, this is wrong"
end
test "first failure" do
a = 5
b = 7
assert a == b * 2
end
test "error" do
raise_an_error
end
end
```
### Progress Reporter

### Description Reporter

### When focus active
```crystal
describe Focus do
test "not focused" do
end
test! "focused" do
end
test "focused too", :focus do
end
end
```

## Development
Run `./cli readme` to run tests and generate `README.md` from `README.md.ecr` and generate the images of the test outputs (using an alpine docker image).
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.7.0- Tagged
- Nov 16, 2025
- Commit
13d031895e21- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/Ragmaanir/microtest
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 29