1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
require "spec_helper"
describe Hash do
describe "#normalize_param" do
it "should have specs"
end
describe "#to_xml_attributes" do
it "should turn the hash into xml attributes" do
attrs = { :one => "ONE", "two" => "TWO" }.to_xml_attributes
expect(attrs).to match(/one="ONE"/m)
expect(attrs).to match(/two="TWO"/m)
end
it "should preserve _ in hash keys" do
attrs = {
:some_long_attribute => "with short value",
:crash => :burn,
:merb => "uses extlib"
}.to_xml_attributes
expect(attrs).to match(/some_long_attribute="with short value"/)
expect(attrs).to match(/merb="uses extlib"/)
expect(attrs).to match(/crash="burn"/)
end
end
end
|