Sha256: 43e103735af7ba8f123f8be20d025b69e0d879f7a945169d54d96e8deee03b2a

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 Bytes

Contents

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

  class TestFragment
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "TestFragment" : (params[:name] || "TestFragment")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" 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/test_fragment.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/test_fragment.rb