😖

Rspecについてメモしている記事

公開日
8か月前
2023-12-27
更新日
3か月前
2024-06-16
更新履歴

概要

RailsでRspecを使うための情報をメモしておく。

Rspec関連のgemをメモしておく

  • factory_bot_rails
  • shoulda-matchers
  • simplecov
    • カバレッジの測定
  • faker

VS Codeの拡張

  • MateuszDrewniak.ruby-test-runner

simplecovの使い方メモ

gem "simplecov", require: false
SimpleCov.start do
 add_filter "/test/"
  add_group "Models", "app/models"
 add_group "Controllers", "app/controllers"
end

Notes

  • Gemfileにおいて、factory-botはdevelopment、test両方のグループに入れておかないと、generateコマンド時にspec/factoriesではなく、test/factoriesに作成されてしまう。

モックについて

receive_message_chain を調べる。