動作確認環境
- Windows10(x64)
- rails 6.1.7
- ruby 3.0.4p208
Gemfileの編集
GemFileに’rspec-rails’を追記する

上記の状態でbundle install を実行する
※bundle install はインターネット接続の必要あり
RSpecの初期設定
rails generate rspec:installをプロジェクトのルートディレクトリで実行する

試しに実行してみる
下記のようなソースを準備します。
describe "テスト分類1" do
it "テスト分類2" do
test_string = "abc"
expect(test_string).to eq "abc"
end
end
ルートディレクトリで「bundle exec rspec」を実行してみると以下のようにテストをパスします

次に下記のようなソースを準備します。
describe "テスト分類1" do
it "テスト分類2" do
test_string = "abc"
expect(test_string).to eq ""
end
end
ルートディレクトリで「bundle exec rspec」を実行してみると以下のようにテストが失敗します。
※上記のコマンドでテストを実行するにはファイル名に「_spec」という接尾語がついている必要があるようです。そいう接尾語でなければ「bundle exec rspec {ファイル名}」のようにして実行する必要がありそう
※変数abcの値は””であることを期待しているが、実際には”abc”だった、という失敗
