Sha256: 80ddee4525b1211a95e7e0c8b22243b4b91591c93c44dd3a7f769d7f600de4c2

Contents?: true

Size: 468 Bytes

Versions: 6

Compression:

Stored size: 468 Bytes

Contents

module Howitzer
  module Web
    # This module mixin capybara context methods
    module CapybaraContextHolder
      # Returns capybara context. For example, capybara session, parent element, etc.

      def capybara_context
        capybara_scopes.last
      end

      private

      def capybara_scopes
        return super if defined?(super)

        raise NotImplementedError, "Please define 'capybara_scopes' method for class holder"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
howitzer-2.6.1 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.6.0 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.5.0 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.4.0 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.3.0 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.2.0 lib/howitzer/web/capybara_context_holder.rb