class Minitest::Spec

Minitest::Spec – The faster, better, less-magical spec framework!

describe blocks take 1-2 arguments describing what is being tested and generate a test class. See Kernel#describe for more details on that. Those describe calls map 1:1 to test classes. See Minitest::Spec::DSL and Minitest::Spec::DSL#it for more details.

For a list of expectations, see Minitest::Expectations.

describe ClassUnderTest, :method_under_test do
  it "returns the correct value" do
    _(1 + 1).must_equal 2               # good
    value(1 + 1).must_equal 2           # same
    expect(1 + 1).must_equal 2          # same
    assert_equal 2, 1+1                 # same, all equivalent to this
    _ { 1 + "1" }.must_raise TypeError  # you can also pass blocks
  end
end