LoginSignup
1
0

More than 3 years have passed since last update.

【RSpec】はじめの一歩の小さなサンプルメモ(コマンドのみ)

Last updated at Posted at 2018-06-07

メモ

作業メモ
 % rspec --init ★設定ファイル等作成
  create   .rspec
  create   spec/spec_helper.rb
 % vim spec/person.rb 
 $ vim spec/person_spec.rb ★specフォルダにテストファイルを記載する
 % ls spec/
person.rb  person_spec.rb  spec_helper.rb
 % rspec ★出力結果は例
..

Finished in 0.00339 seconds (files took 0.14739 seconds to load)
2 examples, 0 failures

参考

RSpec自体のインストールは以下がわかりやすい
https://qiita.com/leon-joel/items/eceddd6a21c615cfeb9a

ディレクトリ構造はspecフォルダの下の構造と、appかlibフォルダの下の構造を同期させる形にしてもよい
(これはRailsの場合だった)
Directory Structure - RSpec Rails - RSpec - Relish https://relishapp.com/rspec/rspec-rails/v/4-0/docs/directory-structure

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0