Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Don't awesome print Capybara elements.

Capybara elements are huge and take quite a long time to output.
One pretty much never wants to awesome print them.

/ht @nathanaelkane
  • Loading branch information...
commit e88952133cfa2de6a829a7b1e91464f7f48bf3ed 1 parent f1149dc
Jason Weathered authored

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +7 2 pryrc
9 pryrc
@@ -43,8 +43,13 @@ org_print = Pry.config.print
43 43 Pry.config.print = proc do |output, value|
44 44 begin
45 45 require 'awesome_print'
46   - value = value.to_a if defined?(ActiveRecord) && defined?(ActiveRecord::Relation) && value.is_a?(ActiveRecord::Relation)
47   - output.puts value.ai
  46 + case
  47 + when defined?(Capybara) && value.is_a?(Capybara::Node::Element)
  48 + org_print.call(output, value)
  49 + else
  50 + value = value.to_a if defined?(ActiveRecord) && defined?(ActiveRecord::Relation) && value.is_a?(ActiveRecord::Relation)
  51 + output.puts value.ai
  52 + end
48 53 rescue LoadError => err
49 54 org_print.call(output, value)
50 55 end

0 comments on commit e889521

Please sign in to comment.
Something went wrong with that request. Please try again.