Sha256: 93d0fa9de86bcaf5a2f6d9b1902c85ec14e5cf3818de19ff189b79ab48c7e36b

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

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

  class SimpleConfigElement
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "SimpleConfigElement" : (params[:name] || "SimpleConfigElement")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <ConfigTestElement guiclass="SimpleConfigGui" testclass="ConfigTestElement" testname="#{testname}" enabled="true"/>
      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/simple_config_element.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/simple_config_element.rb