aixm 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -2
  4. data/CHANGELOG.md +20 -0
  5. data/README.md +7 -2
  6. data/aixm.gemspec +2 -3
  7. data/lib/aixm.rb +6 -2
  8. data/lib/aixm/a.rb +151 -0
  9. data/lib/aixm/component/frequency.rb +2 -2
  10. data/lib/aixm/component/geometry.rb +4 -0
  11. data/lib/aixm/component/geometry/point.rb +0 -4
  12. data/lib/aixm/component/helipad.rb +8 -22
  13. data/lib/aixm/component/runway.rb +36 -36
  14. data/lib/aixm/component/surface.rb +121 -0
  15. data/lib/aixm/component/timetable.rb +1 -0
  16. data/lib/aixm/constants.rb +40 -0
  17. data/lib/aixm/d.rb +5 -0
  18. data/lib/aixm/document.rb +2 -2
  19. data/lib/aixm/f.rb +6 -0
  20. data/lib/aixm/feature/address.rb +100 -0
  21. data/lib/aixm/feature/airport.rb +26 -7
  22. data/lib/aixm/feature/airspace.rb +10 -1
  23. data/lib/aixm/feature/navigational_aid.rb +1 -1
  24. data/lib/aixm/feature/navigational_aid/designated_point.rb +20 -5
  25. data/lib/aixm/feature/navigational_aid/dme.rb +2 -2
  26. data/lib/aixm/{component → feature}/service.rb +67 -16
  27. data/lib/aixm/feature/unit.rb +40 -6
  28. data/lib/aixm/refinements.rb +63 -6
  29. data/lib/aixm/shortcuts.rb +12 -4
  30. data/lib/aixm/version.rb +1 -1
  31. data/lib/aixm/xy.rb +6 -1
  32. data/lib/aixm/z.rb +6 -0
  33. data/schemas/ofmx/0/OFMX-DataTypes.xsd +5 -2
  34. data/schemas/ofmx/0/OFMX-Features.xsd +2 -0
  35. data/spec/factory.rb +32 -10
  36. data/spec/lib/aixm/a_spec.rb +203 -0
  37. data/spec/lib/aixm/component/helipad_spec.rb +11 -17
  38. data/spec/lib/aixm/component/runway_spec.rb +46 -32
  39. data/spec/lib/aixm/component/surface_spec.rb +88 -0
  40. data/spec/lib/aixm/d_spec.rb +10 -0
  41. data/spec/lib/aixm/document_spec.rb +104 -32
  42. data/spec/lib/aixm/f_spec.rb +10 -0
  43. data/spec/lib/aixm/feature/address_spec.rb +55 -0
  44. data/spec/lib/aixm/feature/airport_spec.rb +73 -3
  45. data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +43 -6
  46. data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +2 -2
  47. data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +2 -2
  48. data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +2 -2
  49. data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +2 -2
  50. data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +6 -6
  51. data/spec/lib/aixm/{component → feature}/service_spec.rb +12 -14
  52. data/spec/lib/aixm/feature/unit_spec.rb +7 -4
  53. data/spec/lib/aixm/refinements_spec.rb +100 -15
  54. data/spec/lib/aixm/z_spec.rb +10 -0
  55. metadata +17 -25
  56. data/lib/aixm/h.rb +0 -87
  57. data/spec/lib/aixm/h_spec.rb +0 -113
@@ -1,113 +0,0 @@
1
- require_relative '../../spec_helper'
2
-
3
- describe AIXM::H do
4
- subject do
5
- AIXM::Factory.h
6
- end
7
-
8
- describe :initialize do
9
- it "fails on invalid values" do
10
- -> { AIXM.h('foobar') }.must_raise ArgumentError
11
- end
12
-
13
- it "parses valid values" do
14
- AIXM.h('34L').tap do |h|
15
- h.deg.must_equal 34
16
- h.suffix.must_equal :L
17
- end
18
- AIXM.h(12).tap do |h|
19
- h.deg.must_equal 12
20
- h.suffix.must_be :nil?
21
- end
22
- end
23
- end
24
-
25
- describe :to_s do
26
- it "pads deg with zero and concats suffix" do
27
- AIXM.h(5).to_s.must_equal '05'
28
- AIXM.h('5L').to_s.must_equal '05L'
29
- AIXM.h('16L').to_s.must_equal '16L'
30
- end
31
- end
32
-
33
- describe :deg= do
34
- it "fails on invalid values" do
35
- [:foobar, '1', 0, 37].wont_be_written_to subject, :deg
36
- end
37
-
38
- it "accepts valid values" do
39
- (1..36).to_a.must_be_written_to subject, :deg
40
- end
41
- end
42
-
43
- describe :suffix= do
44
- it "fails on invalid values" do
45
- [123, 'r'].wont_be_written_to subject, :suffix
46
- end
47
-
48
- it "accepts nil value" do
49
- [nil].must_be_written_to subject, :suffix
50
- end
51
-
52
- it "symbolizes valid values" do
53
- subject.tap { |s| s.suffix = 'Z' }.suffix.must_equal :Z
54
- end
55
- end
56
-
57
- describe :invert do
58
- it "must calculate inverse deg correctly" do
59
- {
60
- 1 => 19, 2 => 20, 3 => 21, 4 => 22, 5 => 23, 6 => 24, 7 => 25, 8 => 26, 9 => 27,
61
- 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 18 => 36,
62
- 19 => 1, 20 => 2, 21 => 3, 22 => 4, 23 => 5, 24 => 6, 25 => 7, 26 => 8, 27 => 9,
63
- 28 => 10, 29 => 11, 30 => 12, 31 => 13, 32 => 14, 33 => 15, 34 => 16, 35 => 17, 36 => 18
64
- }.each do |from, to|
65
- AIXM.h(from).invert.deg.must_equal to
66
- end
67
- end
68
-
69
- it "must invert left/right suffix" do
70
- AIXM.h('34L').invert.suffix.must_equal :R
71
- end
72
-
73
- it "must leave other suffixes untouched" do
74
- AIXM.h('35X').invert.suffix.must_equal :X
75
- end
76
- end
77
-
78
- describe :inverse_of? do
79
- it "must return true for inverse pairs" do
80
- AIXM.h('34L').inverse_of?(AIXM.h('16R')).must_equal true
81
- end
82
-
83
- it "must return false for non-inverse pairs" do
84
- AIXM.h('34L').inverse_of?(AIXM.h('12L')).must_equal false
85
- end
86
- end
87
-
88
- describe :== do
89
- it "recognizes objects with identical deg and suffix as equal" do
90
- AIXM.h('34L').must_equal AIXM.h('34L')
91
- end
92
-
93
- it "recognizes objects with different deg or suffix as unequal" do
94
- AIXM.h('34L').wont_equal AIXM.h('35L')
95
- AIXM.h('34L').wont_equal AIXM.h('34R')
96
- end
97
-
98
- it "recognizes objects of different class as unequal" do
99
- subject.wont_equal :oggy
100
- end
101
- end
102
-
103
- describe :hash do
104
- it "returns an integer" do
105
- subject.hash.must_be_instance_of Integer
106
- end
107
-
108
- it "allows for the use of instances as hash keys" do
109
- dupe = subject.dup
110
- { subject => true }[dupe].must_equal true
111
- end
112
- end
113
- end