Sha256: 8344a903991973bb41050969438fd9351035cf748f4ff8567c0aac800e6208e0

Contents?: true

Size: 762 Bytes

Versions: 2

Compression:

Stored size: 762 Bytes

Contents

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

  class DurationAssertion
    attr_accessor :doc
    include Helper

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