Sha256: 522ad035bb922baf2ab38746b2c68c19dbdc1b578f99799758a8a33f38887ef7

Contents?: true

Size: 736 Bytes

Versions: 3

Compression:

Stored size: 736 Bytes

Contents

require 'bbq'
require 'capybara/rails' if Bbq.rails?
require 'bbq/session'
require 'bbq/roles'
require 'bbq/test_user/capybara_dsl'
require 'bbq/test_user/eyes'
require 'bbq/test_user/within'

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

    attr_reader :options

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bbq-0.2.1 lib/bbq/test_user.rb
bbq-0.2.0 lib/bbq/test_user.rb
bbq-0.1.0 lib/bbq/test_user.rb