Sha256: f203b5beca3f356223c0576f645bb1627b141238a66bd552f8373901ec20a7ff
Contents?: true
Size: 891 Bytes
Versions: 8
Compression:
Stored size: 891 Bytes
Contents
require File.expand_path( File.dirname(__FILE__) + '/spec_helper' ) require 'spec_id_xml' describe SpecIDXML, 'included with a simple object' do before(:all) do class Bob include SpecIDXML def initialize(first=nil, second=nil) @first = first ; @second = second end end end it 'creates short element xmls using an objects instance variables' do obj = Bob.new(1, 2) st = obj.short_element_xml_from_instance_vars("bob") # the ordering is arbitrary: "<bob first=\"1\" second=\"2\"/>\n" st.should =~ /second="2"/ st.should =~ /first="1"/ st.should =~ /^<bob / st.should =~ />$/ end it 'escapes special characters' do obj = Bob.new obj.escape_special_chars("&><\"'").should == "&><"'" obj.escape_special_chars("PE&PT>I<D\"E'").should == "PE&PT>I<D"E'" end end
Version data entries
8 entries across 8 versions & 1 rubygems