Sha256: 426613a87b4dc0c8edc880bd5ef58aa58228d04bde6065adbe9902a272c4c85c
Contents?: true
Size: 1.04 KB
Versions: 3
Compression:
Stored size: 1.04 KB
Contents
require 'spec_helper' describe Sekken::XS::SimpleType do specify 'complexType/sequence/element' do simple_type = new_simple_type(' <xs:simpleType name="TemperatureUnit" xmlns="http://www.w3.org/2001/XMLSchema"> <xs:restriction base="xs:string"> <xs:enumeration value="degreeCelsius" /> <xs:enumeration value="degreeFahrenheit" /> <xs:enumeration value="degreeRankine" /> <xs:enumeration value="degreeReaumur" /> <xs:enumeration value="kelvin" /> </xs:restriction> </xs:simpleType> ') expect(simple_type).to be_a(Sekken::XS::SimpleType) restriction = simple_type.children.first expect(restriction).to be_a(Sekken::XS::Restriction) enums = restriction.children expect(enums.count).to eq(5) enums.each do |enum| expect(enum).to be_a(Sekken::XS::Enumeration) end end def new_simple_type(xml) node = Nokogiri.XML(xml).root schemas ||= mock('schemas') schema = {} Sekken::XS::SimpleType.new(node, schemas, schema) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sekken-0.3.0 | spec/sekken/xs/simple_type_spec.rb |
sekken-0.2.0 | spec/sekken/xs/simple_type_spec.rb |
sekken-0.1.0 | spec/sekken/xs/simple_type_spec.rb |