Sha256: 8be74ec993cd29103c44589235e8adbbcc003530ff80a67fcb584c2caa2d697b

Contents?: true

Size: 804 Bytes

Versions: 2

Compression:

Stored size: 804 Bytes

Contents

require 'bbq/core/session'
require 'bbq/core/roles'
require 'bbq/core/test_user/capybara_dsl'
require 'bbq/core/test_user/eyes'
require 'bbq/core/test_user/within'

module Bbq
  module Core
    class TestUser
      include Bbq::Core::TestUser::CapybaraDsl
      include Bbq::Core::TestUser::Eyes
      include Bbq::Core::TestUser::Within
      include Bbq::Core::Roles

      attr_reader :options

      def initialize(options = {})
        @options = default_options.merge(options)
      end

      def default_options
        {
          :pool   => Bbq::Core::Session.pool,
          :driver => ::Capybara.default_driver
        }
      end

      def page
        @page ||= options[:session] || Bbq::Core::Session.next(:driver => options[:driver], :pool => options[:pool])
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bbq-core-0.4.0 lib/bbq/core/test_user.rb
bbq-core-0.3.0 lib/bbq/core/test_user.rb