Sha256: 15a9b9c57453b77fa9bd8c35d7e0f8a7f8c8e179c756537a2b25a9fa1d6f6214

Contents?: true

Size: 787 Bytes

Versions: 3

Compression:

Stored size: 787 Bytes

Contents

module JmeterPerf
  class ExtendedDSL < DSL
    def foreach_controller(params = {}, &)
      node = JmeterPerf::ForeachController.new(params).tap do |node|
        if params[:start_index]
          params[:startIndex] = params[:start_index]
          node.doc.children.first.add_child(
            Nokogiri::XML(<<-EOS.strip_heredoc).children
              <stringProp name="ForeachController.startIndex"/>
            EOS
          )
        end

        if params[:end_index]
          params[:endIndex] = params[:end_index]
          node.doc.children.first.add_child(
            Nokogiri::XML(<<-EOS.strip_heredoc).children
              <stringProp name="ForeachController.endIndex"/>
            EOS
          )
        end
      end

      attach_node(node, &)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jmeter_perf-0.0.7 lib/jmeter_perf/extend/controllers/foreach_controller.rb
jmeter_perf-0.0.6 lib/jmeter_perf/extend/controllers/foreach_controller.rb
jmeter_perf-0.0.2 lib/jmeter_perf/extend/controllers/foreach_controller.rb