Sha256: e1e460a74ac0788d1c0d9ac6fa2b954a7b031b87faec444839d7c0e79261074f
Contents?: true
Size: 758 Bytes
Versions: 79
Compression:
Stored size: 758 Bytes
Contents
require 'test_helper' describe "Crack::Util.to_xml_attributes" do before do @hash = { :one => "ONE", "two" => "TWO", :three => "it \"should\" work" } end it "turn the hash into xml attributes" do attrs = Crack::Util.to_xml_attributes(@hash) attrs.must_match /one="ONE"/m attrs.must_match /two="TWO"/m attrs.must_match /three="it "should" work"/m end it "preserve _ in hash keys" do attrs = Crack::Util.to_xml_attributes({ :some_long_attribute => "with short value", :crash => :burn, :merb => "uses extlib" }) attrs.must_match /some_long_attribute="with short value"/ attrs.must_match /merb="uses extlib"/ attrs.must_match /crash="burn"/ end end
Version data entries
79 entries across 71 versions & 13 rubygems