RSpecいろいろ

  • 全実行
$ rake spec
(in /Users/seiryo/Documents/work/tiqav)
/Users/seiryo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -S bundle exec rspec ./spec/controllers/tiqav_controller_spec.rb ./spec/helpers/tiqav_helper_spec.rb ./spec/models/leaf_spec.rb ./spec/views/tiqav/index.html.haml_spec.rb ./spec/views/tiqav/show.html.haml_spec.rb
..*....**
(中略)
Finished in 11.37 seconds
9 examples, 0 failures, 3 pending
  • あるファイルだけ実行
$ bundle exec rspec spec/controllers/tiqav_controller_spec.rb
..

Finished in 6.58 seconds
2 examples, 0 failures
  • あるファイルだけ実行して、詳細を出力
  • 出力フォーマットは以下の4種類から選ぶ
 [p]rogress (default - dots)
 [d]ocumentation (group and example names)
 [h]tml
 [t]extmate
  • documentation
$ bundle exec rspec spec/controllers/tiqav_controller_spec.rb -f d

TiqavController
  GET '/'
    routes
      should route to {:controller=>"tiqav", :action=>"index"}
    response
      should be success

Finished in 11.95 seconds
describe TiqavHelper do
  pending "add some examples to (or delete) #{__FILE__}"
end