とりあえず動くのでリリースしようぜ、でv0.1.0をリリースした
CIを速くするためのプラクティスとして「ログ出力を止める」というのがある
コード自体は基本的には大したことしてないが、RSpecと連携させるところで苦労した
テストのほうが大変だった
↓のようなテストを作ることで、minitestの上でRSpecを動かすことができる
group.run
に対してreporterというものを引数で渡さないとformatterが発火しない(NullReporterがデフォルト値になっている)、というところで1時間ほど溶かした><Reporter.new
のようにするとformatterと紐付いていないreporterができてしまい意図通りにformatterが発火しない
@reporter = RSpec.configuration.formatter_loader.reporter
test "success test doesn't write logs on CiLogger enabled" do
group = RSpec.describe 'hello', type: :request
group.example do
get '/users'
expect(response.status).to eq 200
end
group.run(@reporter)
assert File.empty?(LOGFILE_PATH)
end
Name <email@example.com>
形式にするためのメソッド" <foo@example.com>"
のように微妙な表示になっていたのがメールアドレスだけを返すようになった