Sha256: 4305ac8f38c8a855c299208e909d982bec05d6e58ea6b1ec8684c3ba000abcf0

Contents?: true

Size: 448 Bytes

Versions: 3

Compression:

Stored size: 448 Bytes

Contents

require 'capybara/session'

module Capybara
  class Session
    SAVE_SCREENSHOT_METHODS = NODE_METHODS + [
      :visit, :has_title?, :has_no_title?, :go_back, :go_forward
    ]

    SAVE_SCREENSHOT_METHODS.each do |method|
      alias_method "after_hook_#{method}".to_sym, method

      define_method method do |*args, &block|
        Gnawrnip.photographer.take_shot
        send("after_hook_#{method}", *args, &block)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gnawrnip-0.3.0 lib/gnawrnip/ext/capybara/session.rb
gnawrnip-0.2.5 lib/gnawrnip/ext/capybara/session.rb
gnawrnip-0.2.4 lib/gnawrnip/ext/capybara/session.rb