ncs_mdes 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,12 @@ module NcsNavigator::Mdes
32
32
  end
33
33
 
34
34
  shared_examples 'tables fully resolved' do
35
+ let!(:tables) { Specification.new(version, :log => logger).transmission_tables }
36
+
37
+ it 'has the right number of tables' do
38
+ tables.size.should == expected_table_count
39
+ end
40
+
35
41
  it 'emits no warnings' do
36
42
  logger[:warn].should == []
37
43
  end
@@ -50,21 +56,29 @@ module NcsNavigator::Mdes
50
56
  end
51
57
 
52
58
  context 'in version 1.2' do
53
- let!(:tables) { Specification.new('1.2', :log => logger).transmission_tables }
54
-
55
- it 'has 124 tables' do
56
- tables.size.should == 124
57
- end
59
+ let(:version) { '1.2' }
60
+ let(:expected_table_count) { 124 }
58
61
 
59
62
  include_examples 'tables fully resolved'
60
63
  end
61
64
 
62
65
  context 'in version 2.0' do
63
- let!(:tables) { Specification.new('2.0', :log => logger).transmission_tables }
66
+ let(:version) { '2.0' }
67
+ let(:expected_table_count) { 264 }
64
68
 
65
- it 'has 264 tables' do
66
- tables.size.should == 264
67
- end
69
+ include_examples 'tables fully resolved'
70
+ end
71
+
72
+ context 'in version 2.1' do
73
+ let(:version) { '2.1' }
74
+ let(:expected_table_count) { 270 }
75
+
76
+ include_examples 'tables fully resolved'
77
+ end
78
+
79
+ context 'in version 2.2' do
80
+ let(:version) { '2.2' }
81
+ let(:expected_table_count) { 329 }
68
82
 
69
83
  include_examples 'tables fully resolved'
70
84
  end
@@ -110,7 +124,22 @@ module NcsNavigator::Mdes
110
124
  code.interim_code.should == "010"
111
125
  code.final_code.should == "510"
112
126
  end
127
+ end
128
+
129
+ context 'in version 2.1' do
130
+ let(:disposition_codes) { Specification.new('2.1', :log => logger).disposition_codes }
131
+
132
+ it 'has 251 codes' do
133
+ disposition_codes.size.should == 251
134
+ end
135
+ end
136
+
137
+ context 'in version 2.2' do
138
+ let(:disposition_codes) { Specification.new('2.2', :log => logger).disposition_codes }
113
139
 
140
+ it 'has 251 codes' do
141
+ disposition_codes.size.should == 251
142
+ end
114
143
  end
115
144
  end
116
145
 
@@ -140,11 +169,11 @@ module NcsNavigator::Mdes
140
169
  should be_a VariableType
141
170
  end
142
171
 
143
- context 'in version 1.2' do
144
- let!(:types) { Specification.new('1.2', :log => logger).types }
172
+ shared_examples 'types fully resolved' do
173
+ let!(:types) { Specification.new(version, :log => logger).types }
145
174
 
146
- it 'has 281 types' do
147
- types.size.should == 281
175
+ it 'has the expected number of types' do
176
+ types.size.should == expected_type_count
148
177
  end
149
178
 
150
179
  it 'emits no warnings' do
@@ -152,16 +181,32 @@ module NcsNavigator::Mdes
152
181
  end
153
182
  end
154
183
 
184
+ context 'in version 1.2' do
185
+ let(:version) { '1.2' }
186
+ let(:expected_type_count) { 281 }
187
+
188
+ include_examples 'types fully resolved'
189
+ end
190
+
155
191
  context 'in version 2.0' do
156
- let!(:types) { Specification.new('2.0', :log => logger).types }
192
+ let(:version) { '2.0' }
193
+ let(:expected_type_count) { 423 }
157
194
 
158
- it 'has 423 types' do
159
- types.size.should == 423
160
- end
195
+ include_examples 'types fully resolved'
196
+ end
161
197
 
162
- it 'emits no warnings' do
163
- logger[:warn].size.should == 0
164
- end
198
+ context 'version 2.1' do
199
+ let(:version) { '2.1' }
200
+ let(:expected_type_count) { 433 }
201
+
202
+ include_examples 'types fully resolved'
203
+ end
204
+
205
+ context 'version 2.2' do
206
+ let(:version) { '2.2' }
207
+ let(:expected_type_count) { 454 }
208
+
209
+ include_examples 'types fully resolved'
165
210
  end
166
211
  end
167
212
  end
@@ -345,7 +345,8 @@ XSD
345
345
  let(:tables) { all_tables }
346
346
 
347
347
  before do
348
- variable.resolve_foreign_key!(tables, override, :log => logger)
348
+ variable.resolve_foreign_key!(tables, override,
349
+ :log => logger, :in_table => TransmissionTable.new('kite'))
349
350
  end
350
351
 
351
352
  shared_examples 'a foreign key' do
@@ -361,7 +362,7 @@ XSD
361
362
 
362
363
  it 'warns' do
363
364
  logger[:warn].first.
364
- should == 'Foreign key not resolvable: no tables have a primary key named "helicopter_id".'
365
+ should == 'Foreign key in kite not resolvable: no tables have a primary key named "helicopter_id".'
365
366
  end
366
367
  end
367
368
 
@@ -405,7 +406,7 @@ XSD
405
406
 
406
407
  it 'warns' do
407
408
  logger[:warn].first.
408
- should == '3 possible parent tables found for foreign key "helicopter_id": "helicopters", "helicopters_2", "choppers". None used due to ambiguity.'
409
+ should == '3 possible parent tables found for foreign key "helicopter_id" in kite: "helicopters", "helicopters_2", "choppers". None used due to ambiguity.'
409
410
  end
410
411
  end
411
412
 
@@ -436,7 +437,7 @@ XSD
436
437
 
437
438
  it 'warns' do
438
439
  logger[:warn].first.
439
- should == 'Foreign key "helicopter_id" explicitly mapped to unknown table "aircraft".'
440
+ should == 'Foreign key "helicopter_id" in kite explicitly mapped to unknown table "aircraft".'
440
441
  end
441
442
  end
442
443
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncs_mdes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
5
- prerelease: false
4
+ hash: 7
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 5
8
+ - 6
9
9
  - 0
10
- version: 0.5.0
10
+ version: 0.6.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rhett Sutphin
@@ -15,13 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-29 00:00:00 -06:00
19
- default_executable:
18
+ date: 2012-05-22 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- name: nokogiri
23
21
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
23
  none: false
26
24
  requirements:
27
25
  - - ~>
@@ -31,12 +29,12 @@ dependencies:
31
29
  - 1
32
30
  - 4
33
31
  version: "1.4"
32
+ requirement: *id001
33
+ name: nokogiri
34
34
  type: :runtime
35
- version_requirements: *id001
36
35
  - !ruby/object:Gem::Dependency
37
- name: rspec
38
36
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
40
38
  none: false
41
39
  requirements:
42
40
  - - ~>
@@ -47,12 +45,12 @@ dependencies:
47
45
  - 6
48
46
  - 0
49
47
  version: 2.6.0
48
+ requirement: *id002
49
+ name: rspec
50
50
  type: :development
51
- version_requirements: *id002
52
51
  - !ruby/object:Gem::Dependency
53
- name: rake
54
52
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
53
+ version_requirements: &id003 !ruby/object:Gem::Requirement
56
54
  none: false
57
55
  requirements:
58
56
  - - ~>
@@ -63,12 +61,12 @@ dependencies:
63
61
  - 9
64
62
  - 2
65
63
  version: 0.9.2
64
+ requirement: *id003
65
+ name: rake
66
66
  type: :development
67
- version_requirements: *id003
68
67
  - !ruby/object:Gem::Dependency
69
- name: yard
70
68
  prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
69
+ version_requirements: &id004 !ruby/object:Gem::Requirement
72
70
  none: false
73
71
  requirements:
74
72
  - - ~>
@@ -79,12 +77,12 @@ dependencies:
79
77
  - 7
80
78
  - 2
81
79
  version: 0.7.2
80
+ requirement: *id004
81
+ name: yard
82
82
  type: :development
83
- version_requirements: *id004
84
83
  - !ruby/object:Gem::Dependency
85
- name: ci_reporter
86
84
  prerelease: false
87
- requirement: &id005 !ruby/object:Gem::Requirement
85
+ version_requirements: &id005 !ruby/object:Gem::Requirement
88
86
  none: false
89
87
  requirements:
90
88
  - - ~>
@@ -94,8 +92,9 @@ dependencies:
94
92
  - 1
95
93
  - 6
96
94
  version: "1.6"
95
+ requirement: *id005
96
+ name: ci_reporter
97
97
  type: :development
98
- version_requirements: *id005
99
98
  description: |
100
99
 
101
100
  Provides a consistent ruby interface to the project metainformation in the
@@ -111,10 +110,12 @@ extra_rdoc_files: []
111
110
 
112
111
  files:
113
112
  - .gitignore
113
+ - .rspec
114
114
  - .rvmrc
115
115
  - .yardopts
116
116
  - CHANGELOG.md
117
117
  - Gemfile
118
+ - HEURISTICS.md
118
119
  - README.md
119
120
  - Rakefile
120
121
  - bin/mdes-console
@@ -124,6 +125,14 @@ files:
124
125
  - documents/2.0/NCS_Transmission_Schema_2.0.01.02.xml
125
126
  - documents/2.0/disposition_codes.yml
126
127
  - documents/2.0/heuristic_overrides.yml
128
+ - documents/2.1/NCS_Transmission_Schema_2.1.00.00.xsd
129
+ - documents/2.1/disposition_codes.yml
130
+ - documents/2.1/extract_disposition_codes.rb
131
+ - documents/2.1/heuristic_overrides.yml
132
+ - documents/2.2/NCS_Transmission_Schema_2.2.01.00.xsd
133
+ - documents/2.2/disposition_codes.yml
134
+ - documents/2.2/extract_disposition_codes.rb
135
+ - documents/2.2/heuristic_overrides.yml
127
136
  - lib/ncs_navigator/mdes.rb
128
137
  - lib/ncs_navigator/mdes/disposition_code.rb
129
138
  - lib/ncs_navigator/mdes/source_documents.rb
@@ -141,7 +150,6 @@ files:
141
150
  - spec/ncs_navigator/mdes/version_spec.rb
142
151
  - spec/ncs_navigator/mdes_spec.rb
143
152
  - spec/spec_helper.rb
144
- has_rdoc: true
145
153
  homepage: ""
146
154
  licenses: []
147
155
 
@@ -171,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
179
  requirements: []
172
180
 
173
181
  rubyforge_project:
174
- rubygems_version: 1.3.7
182
+ rubygems_version: 1.8.15
175
183
  signing_key:
176
184
  specification_version: 3
177
185
  summary: A ruby API for various versions of the NCS MDES.
@@ -184,3 +192,4 @@ test_files:
184
192
  - spec/ncs_navigator/mdes/version_spec.rb
185
193
  - spec/ncs_navigator/mdes_spec.rb
186
194
  - spec/spec_helper.rb
195
+ has_rdoc: