spec/lib/aixm/component/helipad_spec.rb in aixm-0.3.7 vs spec/lib/aixm/component/helipad_spec.rb in aixm-0.3.8
- old
+ new
@@ -5,102 +5,102 @@
AIXM::Factory.airport.helipads.first
end
describe :name= do
it "fails on invalid values" do
- [nil, :foobar, 123].wont_be_written_to subject, :name
+ _([nil, :foobar, 123]).wont_be_written_to subject, :name
end
it "upcases and transcodes valid values" do
- subject.tap { |s| s.name = 'h1' }.name.must_equal 'H1'
+ _(subject.tap { |s| s.name = 'h1' }.name).must_equal 'H1'
end
end
describe :xy= do
macro :xy
it "fails on nil value" do
- [nil].wont_be_written_to subject, :xy
+ _([nil]).wont_be_written_to subject, :xy
end
end
describe :z= do
macro :z_qnh
end
describe :length= do
it "fails on invalid values" do
- [:foobar, 0, 1, AIXM.d(0, :m)].wont_be_written_to subject, :length
+ _([:foobar, 0, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :length
end
it "accepts nil value" do
- [nil].must_be_written_to subject, :length
+ _([nil]).must_be_written_to subject, :length
end
end
describe :width= do
it "fails on invalid values" do
- [:foobar, 0, 1, AIXM.d(0, :m)].wont_be_written_to subject, :width
+ _([:foobar, 0, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :width
end
it "accepts nil value" do
- [nil].must_be_written_to subject, :width
+ _([nil]).must_be_written_to subject, :width
end
end
describe :marking= do
macro :marking
end
describe :fato= do
it "fails on invalid values" do
- [:foobar, 0].wont_be_written_to subject, :fato
+ _([:foobar, 0]).wont_be_written_to subject, :fato
end
it "accepts valid values" do
- [nil, AIXM::Factory.fato].must_be_written_to subject, :fato
+ _([nil, AIXM::Factory.fato]).must_be_written_to subject, :fato
end
end
describe :helicopter_class= do
it "fails on invalid values" do
- [:foobar, 123].wont_be_written_to subject, :helicopter_class
+ _([:foobar, 123]).wont_be_written_to subject, :helicopter_class
end
it "accepts nil value" do
- [nil].must_be_written_to subject, :helicopter_class
+ _([nil]).must_be_written_to subject, :helicopter_class
end
it "looks up valid values" do
- subject.tap { |s| s.helicopter_class = 1 }.helicopter_class.must_equal :'1'
- subject.tap { |s| s.helicopter_class = :OTHER }.helicopter_class.must_equal :other
+ _(subject.tap { |s| s.helicopter_class = 1 }.helicopter_class).must_equal :'1'
+ _(subject.tap { |s| s.helicopter_class = :OTHER }.helicopter_class).must_equal :other
end
end
describe :status= do
it "fails on invalid values" do
- [:foobar, 123].wont_be_written_to subject, :status
+ _([:foobar, 123]).wont_be_written_to subject, :status
end
it "accepts nil value" do
- [nil].must_be_written_to subject, :status
+ _([nil]).must_be_written_to subject, :status
end
it "looks up valid values" do
- subject.tap { |s| s.status = :closed }.status.must_equal :closed
- subject.tap { |s| s.status = :SPOWER }.status.must_equal :secondary_power
+ _(subject.tap { |s| s.status = :closed }.status).must_equal :closed
+ _(subject.tap { |s| s.status = :SPOWER }.status).must_equal :secondary_power
end
end
describe :remarks= do
macro :remarks
end
describe :xml= do
it "builds correct complete OFMX" do
AIXM.ofmx!
- subject.to_xml.must_equal <<~END
+ _(subject.to_xml).must_equal <<~END
<Tla>
<TlaUid>
<AhpUid>
<codeId>LFNT</codeId>
</AhpUid>
@@ -161,11 +161,11 @@
it "builds correct minimal OFMX" do
AIXM.ofmx!
%i(z length width helicopter_class marking status remarks).each { |a| subject.send(:"#{a}=", nil) }
%i(composition preparation condition pcn siwl_weight siwl_tire_pressure auw_weight remarks).each { |a| subject.surface.send(:"#{a}=", nil) }
subject.instance_eval { @lightings.clear }
- subject.to_xml.must_equal <<~END
+ _(subject.to_xml).must_equal <<~END
<Tla>
<TlaUid>
<AhpUid>
<codeId>LFNT</codeId>
</AhpUid>
@@ -180,8 +180,14 @@
<geoLat>43.99915000N</geoLat>
<geoLong>004.75154444E</geoLong>
<codeDatum>WGE</codeDatum>
</Tla>
END
+ end
+
+ it "builds OFMX with mid" do
+ AIXM.ofmx!
+ AIXM.config.mid_region = 'LF'
+ _(subject.to_xml).must_match /<TlaUid mid="c1f675f9-ed0f-e52e-b117-f9fe6a00fe7c">/
end
end
end