spec/lib/aixm/feature/airspace_spec.rb in aixm-0.2.0 vs spec/lib/aixm/feature/airspace_spec.rb in aixm-0.2.1

- old
+ new

@@ -29,14 +29,14 @@ it "must return digest of payload" do subject.to_digest.must_equal 367297292 end end - describe :to_xml do + describe :to_aixm do it "must build correct XML with OFM extensions" do digest = subject.to_digest - subject.to_xml(:ofm).must_equal <<~"END" + subject.to_aixm(:ofm).must_equal <<~"END" <!-- Airspace: [D] POLYGON AIRSPACE --> <Ase xt_classLayersAvail="false"> <AseUid mid="#{digest}" newEntity="true"> <codeType>D</codeType> <codeId>#{digest}</codeId> @@ -114,14 +114,14 @@ it "must return digest of payload" do subject.to_digest.must_equal 481196243 end end - describe :to_xml do + describe :to_aixm do it "must build correct XML with OFM extensions" do digest = subject.to_digest - subject.to_xml(:ofm).must_equal <<~"END" + subject.to_aixm(:ofm).must_equal <<~"END" <!-- Airspace: [D] POLYGON AIRSPACE --> <Ase xt_classLayersAvail="true"> <AseUid mid="#{digest}" newEntity="true"> <codeType>D</codeType> <codeId>#{digest}</codeId> @@ -234,22 +234,26 @@ end end end context "partially complete" do + subject do + AIXM::Factory.polygon_airspace + end + it "must build correct XML without short name" do - subject = AIXM::Factory.polygon_airspace(short_name: nil) - subject.to_xml.wont_match(/txtLocalType/) + subject.short_name = nil + subject.to_aixm.wont_match(/txtLocalType/) end it "must build correct XML with identical name and short name" do - subject = AIXM::Factory.polygon_airspace(short_name: 'POLYGON AIRSPACE') - subject.to_xml.wont_match(/txtLocalType/) + subject.short_name = 'POLYGON AIRSPACE' + subject.to_aixm.wont_match(/txtLocalType/) end it "must build correct XML without schedule" do - subject = AIXM::Factory.polygon_airspace(schedule: nil) - subject.to_xml.wont_match(/codeWorkHr/) + subject.schedule = nil + subject.to_aixm.wont_match(/codeWorkHr/) end end end end