Sha256: 0c3759cab6b7666683bdacb0078f56a874bfe0835a080da5c8bf6413901e9419

Contents?: true

Size: 688 Bytes

Versions: 9

Compression:

Stored size: 688 Bytes

Contents

begin
  require 'builder'
rescue LoadError
  gem 'builder'
  require 'builder'
end

module Cucumber
  module Formatter
    # Emits attributes ordered alphabetically, so that we can predicatbly test output.
    class OrderedXmlMarkup < Builder::XmlMarkup
      def _insert_attributes(attrs, order=[])
        return if attrs.nil?
        keys = attrs.keys.map{|k| k.to_s}
        keys.sort!
        keys.reverse! if (attrs.keys - [:version, :encoding] == []) #HACK to ensure the 'version' attribute is first in xml declaration.
        keys.each do |k|
          v = attrs[k.to_sym] || attrs[k]
          @target << %{ #{k}="#{_attr_value(v)}"} if v
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
aslakhellesoy-cucumber-0.3.94.1 lib/cucumber/formatter/ordered_xml_markup.rb
aslakhellesoy-cucumber-0.3.95 lib/cucumber/formatter/ordered_xml_markup.rb
aslakhellesoy-cucumber-0.3.96 lib/cucumber/formatter/ordered_xml_markup.rb
kosmas58-cucumber-0.3.95 lib/cucumber/formatter/ordered_xml_markup.rb
kosmas58-cucumber-0.3.96 lib/cucumber/formatter/ordered_xml_markup.rb
pezra-cucumber-0.3.94.1 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-0.3.96 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-0.3.95 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-0.3.94 lib/cucumber/formatter/ordered_xml_markup.rb