Skip to content

Instantly share code, notes, and snippets.

View snehaso's full-sized avatar

Sneha Somwanshi snehaso

  • Thoughtworks
  • London, UK
View GitHub Profile
@snehaso
snehaso / browser_logging.rb
Created July 8, 2020 16:12 — forked from zdennis/browser_logging.rb
Chromedriver browser logging for Capybara
# browser_logging.rb will print out the browser log from Chrome
# when running specs with "js: true". This is so we can easily debug
# issues where there are JS errors or other console warnings/error(s), etc.
#
# Output file is: Rails.root/log/browser.log
#
# Note: Nothing will be printed out for non-JS examples.
RSpec.configure do |config|
browser_log = File.new(Rails.root.join("log/browser.log").to_s, "w")
browser_log.sync = true
@shiroyasha
shiroyasha / dog.rb
Created February 16, 2016 22:20
Method tracer for Ruby classes
class Dog
attr_writer :name
def initialize(name)
@name = name
end
def bark
puts "patrick"
end