← 返回命令列表

Linux command

minitest 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run all tests

ruby -Ilib:test [test/test_*.rb]

Run specific test file

ruby -Ilib:test [test/test_example.rb]

Run tests with verbose output

ruby -Ilib:test [test/test_example.rb] --verbose

Run specific test method

ruby -Ilib:test [test/test_example.rb] --name [test_method_name]

Run with pattern

ruby -Ilib:test [test/test_example.rb] --name /[pattern]/

说明

Minitest is a testing framework for Ruby that provides a complete suite of testing facilities. It includes unit tests, specs, mocking, and benchmarking. Minitest is bundled with Ruby and is known for being fast and simple.

参数

--verbose
Verbose output.
--name _pattern_
Run matching tests.
--seed _n_
Random seed.
--pride
Rainbow output.

FAQ

What is the minitest command used for?

Minitest is a testing framework for Ruby that provides a complete suite of testing facilities. It includes unit tests, specs, mocking, and benchmarking. Minitest is bundled with Ruby and is known for being fast and simple.

How do I run a basic minitest example?

Run `ruby -Ilib:test [test/test_*.rb]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --verbose do in minitest?

Verbose output.