Piotr Brudny
Piotr Brudny

Reputation: 656

How to use Pry with Cucumber / Capybara?

What should I do to use Pry for debuging my Cucumber steps? Here is an example.

When 'I download a PDF via "$label"' do |label|
  old_body = page.body
  click_link(label)
  page.driver.instance_variable_set '@body', page.body.pdf_to_text
  binding.pry
end

When I run a single scenario with that step I get access to Pry console

[1] pry(#<Cucumber::Rails::World>)>

but I can't write anything. It seems that it stops working. Any ideas?

Upvotes: 3

Views: 2105

Answers (1)

Piotr Brudny
Piotr Brudny

Reputation: 656

I did the same thing again after upgrading Rails to 3.2.10 + Capybara to 2.0.2 and now Pry works flawless.

Upvotes: 2

Related Questions