> [!METADATA]+
> **Type**:: [[Conference Talk]]
> **Conference**:: [[Sin City Ruby 2022]]
> **Authors**:: [[Nikita Vasilevsky]]
> **Links**::
## Notes
- [[Nikita Vasilevsky]]
- Ruby on Rails Infrastructure Team
- Using `ensure` in tests to make sure that if a raise happens in a test you can still do teardown
- Adding if conditions to end of test blocks instead of using `skip`
- [`flunk`](https://www.rubydoc.info/gems/minitest/5.8.3/Minitest%2FAssertions%3Aflunk)
- [[Shopify]] uses `mocha`
- `minitest-reporters` can assist with finding tests without missing assertions
```ruby
config.after(:each) do |example|
return if example.passed? || example.expectations_count.positive?
$stderr, puts("test at #{example.location} seem to have no expectations")
end
```
```ruby
def after_teardown
super
if !error && assertions == 0
raise Minitest::Assertion, "Test missing assertions"
end
end
```