Sha256: 539fd706a7052d6f9ebd9c50c127c8c4b6587e47c600a15923c834c914d698bc

Contents?: true

Size: 612 Bytes

Versions: 2

Compression:

Stored size: 612 Bytes

Contents

require 'load_impact/page'

# LoadImpact::UserScenario class that allows us to convert a list of URL's
# into a Load Impact user scenario without using their record and playback.
#
# Example:
#   urls = %w[http://qa1load.nandomedia.com http://qa1load.nandomedia.com/news]
#   scenario = LoadImpact::UserScenario.new(urls)
#   puts scenario.to_s
#

module LoadImpact
  class UserScenario
    attr_reader :urls

    def initialize(urls)
      @urls = urls
    end

    def to_s
      <<-EOS.gsub(/^\s+\|\s/, '')
        | #{urls.map { |url| Page.new(url).to_s }.compact.join}
        |
      EOS
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
load_impact-0.0.2 lib/load_impact/user_scenario.rb
load_impact-0.0.1 lib/load_impact/user_scenario.rb