🙋 Minitest users, I need your feedback on Hanami’s upcoming Minitest support! https://discourse.hanamirb.org/t/feedback-on-hanami-minitest/1415

#ruby #minitest

Feedback on Hanami Minitest

Hi everyone — I’m pleased to share that our initial Minitest support is now merged into the gem’s main branch. I’ve implemented the block-based test/setup/teardown API, as you suggested above (with some tweaks to make it fit better with setup and teardown methods in superclasses). I decided to host the base classes inside the gem. They exist as Hanami::Minitest::{Test,RequestTest,FeatureTest}. I’ve also take the opportunity to use this as a first foray into internalising some of the test setup...

Hanami

@timriley FWIW, I've found providing a mix-in module to be a reasonable alternative to struggling with base class names. For example:

# frozen_string_literal: true

require "test_helper"

class TestHelloWorld < Minitest::Test
include Rooibos::TestHelper

def test_it_exits_with_ctrl_c
with_test_terminal do
inject_key(:ctrl_c)
Rooibos.run(HelloWorld)
assert true, "Should reach this point without hanging."
end
end
end

@kerrick @timriley I would suggest subclassing from your own test subclass, eg Hanami::Test, and have FeatureTest et al in the same namespace