Sha256: 3521fae1c4f23dff0bab7c3df7f8bed18708ccc8d04426658c45c1be0ce8e2cf

Contents?: true

Size: 467 Bytes

Versions: 5

Compression:

Stored size: 467 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

5 entries across 5 versions & 1 rubygems

Version Path
howitzer-2.1.1 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.1.0 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.0.3 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.0.2 lib/howitzer/web/capybara_context_holder.rb
howitzer-2.0.1 lib/howitzer/web/capybara_context_holder.rb