minitest を行数指定で使う (Rails)
Ruby on Rails Ruby
Published: 2020-03-07

やったこと

minitest を行数指定で実行します。

確認環境

$ ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin17]

$ rails --version
Rails 5.2.3

調査

準備

$ rails g model book title:string status:integer
$ rails db:migrate

test/models/book_test.rb

require 'test_helper'

class BookTest < ActiveSupport::TestCase
  test "the truth" do
    assert true
  end

  test "the truth222" do
    assert true
  end
end

テストを実行する

$ rails test test/models/book_test.rb:8
Running via Spring preloader in process 46538
Run options: --seed 24522

# Running:

.

Finished in 0.011685s, 85.5798 runs/s, 85.5798 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips

参考