Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binding pry not being called in test environment

I'm currently writing specs for my Rails controller. I can't seem to get any puts statement or binding.pry, or binding.remote_pry working.

I am able to get the remote pry working in the development environment.

group :development, :test do
  gem 'rspec-rails', '~> 3.0'
  gem 'capybara'
  gem 'factory_girl_rails'
  gem 'daemons'
  gem 'pry-rails'
  gem 'pry-remote'
  gem 'binding_of_caller'
end
like image 855
Sherwyn Goh Avatar asked Feb 11 '15 00:02

Sherwyn Goh


1 Answers

It seems that you need to require 'pry' somewhere in your test environment before invoking it. Your spec_helper.rb, test_helper.rb or similar is probably a good place.

like image 147
Dan Avatar answered Sep 29 '22 04:09

Dan