Sha256: 40a5228179f00c69973e0ce58f7d0e668f4e6a6e78663ad7b1c57d4d1120d185

Contents?: true

Size: 743 Bytes

Versions: 2

Compression:

Stored size: 743 Bytes

Contents

module JmeterPerf
  class DSL
    def while_controller(params = {}, &)
      node = JmeterPerf::WhileController.new(params)
      attach_node(node, &)
    end
  end

  class WhileController
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "WhileController" : (params[:name] || "WhileController")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="#{testname}" enabled="true">
          <stringProp name="WhileController.condition"/>
        </WhileController>
      EOS
      update params
      update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jmeter_perf-0.0.6 lib/jmeter_perf/dsl/while_controller.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/while_controller.rb