LoginSignup
26
20

More than 5 years have passed since last update.

Rspecでbinding.pryを行いたい

Last updated at Posted at 2014-12-19

前提

Gemfileにpry-railsを入れている。

group :development, :test do
  gem 'pry-rails'
end

これで下記のように

RSpec.describe Model, :type => :model do
  describe "test" do 
    binding.pry # ここで処理がとまる

    以下、テストコード...

end

当たり前っちゃあ、当たり前。

参考URL

http://stackoverflow.com/questions/5446594/running-ruby-debug-in-rspec

26
20
1

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
26
20