gooby 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +48 -67
- data/bin/20050305_corporate_cup_hm_to_csv.rb +9 -0
- data/bin/20050430_nashville_marathon_to_csv.rb +9 -0
- data/bin/20060115_phoenix_marathon_to_csv.rb +9 -0
- data/bin/activity_2007_03_10_13_02_32.xml_to_csv.rb +9 -0
- data/bin/{tests_gen.rb → code_scan.rb} +6 -4
- data/bin/example_usage.rb +2 -3
- data/bin/example_usage.sh +52 -0
- data/bin/gen_gap_phx.rb +10 -0
- data/bin/gen_gmap_cc_2005.rb +10 -0
- data/bin/gen_gmap_cc_2007.rb +10 -0
- data/bin/gen_gmap_nashville.rb +10 -0
- data/bin/gen_gmap_phx.rb +10 -0
- data/bin/phx_to_csv.rb +47 -0
- data/bin/split_forerunner_logbook_2007.rb +10 -0
- data/bin/split_training_center_2007.rb +8 -0
- data/data/{2007_03_04.tcx → 2007_03_10.tcx} +11694 -0
- data/data/activity_2007_03_10_13_02_32.csv +1168 -0
- data/data/activity_2007_03_10_13_02_32.xml +11695 -0
- data/data/forerunner_2007.xml +0 -227142
- data/img/gicons/readme.txt +3 -0
- data/lib/gooby.rb +625 -552
- data/samples/20050305_corporate_cup_hm.html +271 -269
- data/samples/20050430_nashville_marathon.html +1240 -246
- data/samples/20060115_phoenix_marathon.html +1596 -0
- data/samples/20070310_corporate_cup_hm.html +1367 -0
- data/samples/phoenix_marathon.html +1312 -258
- data/tests/ts_gooby.rb +423 -551
- data/tests/ts_gooby_min.rb +550 -0
- metadata +25 -67
- data/bin/tcx_ex.rb +0 -35
- data/data/20051124_hyatt_turkey_trot_8K.csv +0 -321
- data/data/20051124_hyatt_turkey_trot_8K.xml +0 -2651
- data/data/2007_03_03.tcx +0 -6207
- data/data/activity_2007_03_04_15_22_36.xml +0 -10545
- data/data/run_2007_01_01_16_38_27.xml +0 -2020
- data/data/run_2007_02_24_15_01_35.csv +0 -484
- data/data/run_2007_02_24_15_01_35.xml +0 -3884
- data/lib/gooby/cls_counter_hash.rb +0 -78
- data/lib/gooby/cls_delim_line.rb +0 -35
- data/lib/gooby/cls_dttm.rb +0 -79
- data/lib/gooby/cls_duration.rb +0 -79
- data/lib/gooby/cls_forerunner_xml_parser.rb +0 -178
- data/lib/gooby/cls_forerunner_xml_splitter.rb +0 -109
- data/lib/gooby/cls_geo_data.rb +0 -181
- data/lib/gooby/cls_gooby_command.rb +0 -46
- data/lib/gooby/cls_gooby_object.rb +0 -18
- data/lib/gooby/cls_google_map_generator.rb +0 -363
- data/lib/gooby/cls_history.rb +0 -33
- data/lib/gooby/cls_lap.rb +0 -22
- data/lib/gooby/cls_line.rb +0 -75
- data/lib/gooby/cls_options.rb +0 -67
- data/lib/gooby/cls_position.rb +0 -44
- data/lib/gooby/cls_run.rb +0 -194
- data/lib/gooby/cls_simple_xml_parser.rb +0 -41
- data/lib/gooby/cls_test_regen.rb +0 -182
- data/lib/gooby/cls_track.rb +0 -47
- data/lib/gooby/cls_trackpoint.rb +0 -200
- data/lib/gooby/cls_training_center_parser.rb +0 -183
- data/lib/gooby/cls_training_center_splitter.rb +0 -109
- data/lib/gooby/mod_introspect.rb +0 -26
- data/lib/gooby/mod_io.rb +0 -58
- data/lib/gooby/mod_project_info.rb +0 -80
- data/lib/gooby/mod_string.rb +0 -19
- data/lib/gooby/mod_test_helper.rb +0 -15
- data/samples/20041113_richmond_marathon.html +0 -532
- data/samples/run_2007_01_10_22_44_54.html +0 -201
- data/samples/run_2007_02_24_15_01_35.html +0 -298
- data/tests/tc_cls_counter_hash.rb +0 -107
- data/tests/tc_cls_delim_line.rb +0 -74
- data/tests/tc_cls_dttm.rb +0 -131
- data/tests/tc_cls_duration.rb +0 -51
- data/tests/tc_cls_forerunner_xml_parser.rb +0 -70
- data/tests/tc_cls_geo_data.xxx +0 -71
- data/tests/tc_cls_gooby_object.rb +0 -26
- data/tests/tc_cls_google_map_generator.rb +0 -109
- data/tests/tc_cls_history.rb +0 -46
- data/tests/tc_cls_lap.rb +0 -38
- data/tests/tc_cls_line.rb +0 -110
- data/tests/tc_cls_options.rb +0 -79
- data/tests/tc_cls_position.rb +0 -66
- data/tests/tc_cls_run.rb +0 -142
- data/tests/tc_cls_simple_xml_parser.rb +0 -50
- data/tests/tc_cls_track.rb +0 -70
- data/tests/tc_cls_trackpoint.rb +0 -145
- data/tests/tc_mod_introspect.rb +0 -32
- data/tests/tc_mod_io.rb +0 -53
- data/tests/tc_mod_project_info.rb +0 -79
- data/tests/tc_mod_string.rb +0 -58
- /data/data/{phx.csv → 20060115_phoenix_marathon.csv} +0 -0
- /data/data/{phx.xml → 20060115_phoenix_marathon.xml} +0 -0
data/tests/ts_gooby.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# Packaged on Fri Mar 09 06:03:09 EST 2007
|
2
|
-
|
3
1
|
=begin
|
4
2
|
|
5
3
|
This contains the regression test suite for the Gooby project.
|
@@ -8,7 +6,6 @@ See file 'lib/gooby.rb' which is the subject of this test suite.
|
|
8
6
|
|
9
7
|
Gooby - Copyright 2007 by Chris Joakim.
|
10
8
|
Gooby is available under GNU General Public License (GPL) license.
|
11
|
-
|
12
9
|
=end
|
13
10
|
|
14
11
|
# The following prefixes ../lib to the active ruby load path
|
@@ -19,338 +16,112 @@ puts $LOAD_PATH
|
|
19
16
|
require 'gooby'
|
20
17
|
require 'test/unit'
|
21
18
|
|
22
|
-
|
23
|
-
class TestModuleCon < Test::Unit::TestCase
|
24
|
-
|
25
|
-
include Gooby::TestHelper
|
26
|
-
|
27
|
-
@debug = false
|
28
|
-
|
29
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
30
|
-
|
31
|
-
def test_module_Con_default_delimiter
|
32
|
-
|
33
|
-
obj = Gooby::GoobyObject.new
|
34
|
-
actual = obj.default_delimiter
|
35
|
-
expected = '|'
|
36
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_module_Con_invalid_distance
|
40
|
-
|
41
|
-
obj = Gooby::GoobyObject.new
|
42
|
-
actual = obj.invalid_distance
|
43
|
-
expected = -99999999
|
44
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_module_Con_invalid_minutes
|
48
|
-
|
49
|
-
obj = Gooby::GoobyObject.new
|
50
|
-
actual = obj.invalid_minutes
|
51
|
-
expected = -99999999
|
52
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_module_Con_invalid_time
|
56
|
-
|
57
|
-
obj = Gooby::GoobyObject.new
|
58
|
-
actual = obj.invalid_time
|
59
|
-
expected = -99999999
|
60
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_module_Con_invalid_latitude
|
64
|
-
|
65
|
-
obj = Gooby::GoobyObject.new
|
66
|
-
actual = obj.invalid_latitude
|
67
|
-
expected = -1
|
68
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_module_Con_invalid_longitude
|
72
|
-
|
73
|
-
obj = Gooby::GoobyObject.new
|
74
|
-
actual = obj.invalid_longitude
|
75
|
-
expected = -1
|
76
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_module_Con_invalid_altitude
|
80
|
-
|
81
|
-
obj = Gooby::GoobyObject.new
|
82
|
-
actual = obj.invalid_altitude
|
83
|
-
expected = -1
|
84
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
class TestModuleIntrospect < Test::Unit::TestCase
|
90
|
-
|
91
|
-
include Gooby::TestHelper
|
92
|
-
|
93
|
-
@debug = false
|
94
|
-
|
95
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
96
|
-
|
97
|
-
def test_module_Introspect
|
98
|
-
|
99
|
-
end
|
100
|
-
|
101
|
-
def test_module_Introspect_introspect
|
102
|
-
|
103
|
-
end
|
104
|
-
|
105
|
-
def test_module_Introspect_to_yaml_properties
|
106
|
-
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
class TestModuleProjectInfo < Test::Unit::TestCase
|
111
|
-
|
112
|
-
include Gooby::TestHelper
|
113
|
-
|
114
|
-
@debug = false
|
115
|
-
|
116
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
117
|
-
|
118
|
-
def test_module_GoobyProjectInfo
|
119
|
-
|
120
|
-
end
|
121
|
-
|
122
|
-
def test_module_GoobyProjectInfo_google_maps_api_level
|
123
|
-
|
124
|
-
obj = Gooby::GoobyObject.new
|
125
|
-
assert_equal '2', obj.google_maps_api_level
|
126
|
-
end
|
127
|
-
|
128
|
-
def test_module_GoobyProjectInfo_project_author
|
129
|
-
|
130
|
-
obj = Gooby::GoobyObject.new
|
131
|
-
end
|
132
|
-
|
133
|
-
def test_module_GoobyProjectInfo_project_copyright
|
134
|
-
|
135
|
-
end
|
136
|
-
|
137
|
-
# Warning: possible obsolete test method - test_module_GoobyProjectInfo_project_copyrightttt
|
138
|
-
|
139
|
-
def test_module_GoobyProjectInfo_project_copyrightttt
|
140
|
-
|
141
|
-
obj = Gooby::GoobyObject.new
|
142
|
-
assert_equal 'Copyright (C) 2007 Chris Joakim', obj.project_copyright
|
143
|
-
end
|
144
|
-
|
145
|
-
def test_module_GoobyProjectInfo_project_date
|
146
|
-
|
147
|
-
obj = Gooby::GoobyObject.new
|
148
|
-
assert_equal '2007/03/03', obj.project_date
|
149
|
-
end
|
150
|
-
|
151
|
-
def test_module_GoobyProjectInfo_project_license
|
152
|
-
|
153
|
-
obj = Gooby::GoobyObject.new
|
154
|
-
assert_equal 'GNU General Public License (GPL). See http://www.gnu.org/copyleft/gpl.html', obj.project_license
|
155
|
-
end
|
156
|
-
|
157
|
-
def test_module_GoobyProjectInfo_project_version_number
|
158
|
-
|
159
|
-
obj = Gooby::GoobyObject.new
|
160
|
-
assert_equal '0.9.4', obj.project_version_number
|
161
|
-
end
|
162
|
-
|
163
|
-
def test_module_GoobyProjectInfo_project_year
|
164
|
-
|
165
|
-
obj = Gooby::GoobyObject.new
|
166
|
-
assert_equal '2007', obj.project_year
|
167
|
-
end
|
168
|
-
|
169
|
-
def test_module_GoobyProjectInfo_some_new_thing
|
170
|
-
|
171
|
-
end
|
172
|
-
|
173
|
-
def test_module_GoobyProjectInfo_tested_files
|
174
|
-
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
class TestModuleGoobyString < Test::Unit::TestCase
|
19
|
+
class TestGoobyKernel < Test::Unit::TestCase
|
179
20
|
|
180
21
|
include Gooby::TestHelper
|
22
|
+
include Gooby::GoobyKernel
|
181
23
|
|
182
24
|
@debug = false
|
183
|
-
|
184
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
185
|
-
|
186
|
-
def test_module_GoobyString
|
187
|
-
|
188
|
-
end
|
189
|
-
|
190
|
-
def test_module_GoobyString_tokenize
|
191
|
-
|
192
|
-
obj = Gooby::GoobyObject.new
|
193
|
-
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
194
|
-
array = obj.tokenize(s, nil)
|
195
|
-
actual = array.size
|
196
|
-
expected = 8
|
197
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
198
|
-
|
199
|
-
actual = array[1]
|
200
|
-
expected = '-80.83214521408081'
|
201
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
202
25
|
|
203
|
-
|
204
|
-
expected = 'Way'
|
205
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
206
|
-
|
207
|
-
obj = Gooby::GoobyObject.new
|
208
|
-
s = 'twain , faulkner, wolfe, caldwell '
|
209
|
-
array = obj.tokenize(s, ',', false)
|
210
|
-
|
211
|
-
actual = array.size
|
212
|
-
expected = 4
|
213
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
214
|
-
|
215
|
-
actual = array[0]
|
216
|
-
expected = 'twain '
|
217
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
218
|
-
|
219
|
-
actual = array[3]
|
220
|
-
expected = ' caldwell '
|
221
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
222
|
-
end
|
223
|
-
end
|
224
|
-
|
225
|
-
class TestModuleGoobyIO < Test::Unit::TestCase
|
226
|
-
|
227
|
-
include Gooby::TestHelper
|
228
|
-
|
229
|
-
@debug = false
|
230
|
-
|
231
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
232
|
-
|
233
|
-
def test_module_GoobyIO
|
234
|
-
|
235
|
-
fn = 'data/test1.txt'
|
236
|
-
obj = Gooby::GoobyObject.new
|
237
|
-
a1 = obj.read_lines(fn, false)
|
238
|
-
a2 = obj.read_lines(fn, true)
|
239
|
-
a3 = obj.read_as_ascii_lines(fn, 10, false)
|
240
|
-
|
241
|
-
puts '' if @debug
|
242
|
-
a1.each { |line| puts line } if @debug
|
243
|
-
a2.each { |line| puts line } if @debug
|
244
|
-
a3.each { |line| puts line } if @debug
|
245
|
-
|
246
|
-
assert_equal('This is just a file', a2[0], "a2[0] is not as expected.")
|
247
|
-
assert_equal('This is just a file', a3[0], "a3[0] is not as expected.")
|
248
|
-
assert_equal('test data.', a2[3], "a2[1] is not as expected.")
|
249
|
-
assert_equal(' test data.', a3[3], "a3[3] is not as expected.")
|
250
|
-
|
251
|
-
puts "todo: implement #{name}" if @debug
|
252
|
-
end
|
26
|
+
# beginning of tests - keep this marker
|
253
27
|
|
254
|
-
def
|
255
|
-
|
256
|
-
end
|
257
|
-
|
258
|
-
def test_module_GoobyIO_read_lines
|
28
|
+
def test_class_CounterHash
|
259
29
|
|
30
|
+
# See the method-level tests below.
|
260
31
|
end
|
261
32
|
|
262
|
-
def
|
33
|
+
def test_class_CounterHash_decrement
|
263
34
|
|
35
|
+
ctr_hash = Gooby::CounterHash.new
|
36
|
+
7.times { ctr_hash.decrement("seven") }
|
37
|
+
391.times { ctr_hash.decrement("391") }
|
38
|
+
assert(ctr_hash.value('seven') == -7, "decremented value not -7.")
|
39
|
+
assert(ctr_hash.value('391') == -391, "decremented value not -391.")
|
40
|
+
assert(ctr_hash.sorted_keys.size == 2, "sorted_keys size is not 2.")
|
264
41
|
end
|
265
|
-
end
|
266
|
-
|
267
|
-
class TestClassCounterHash < Test::Unit::TestCase
|
268
|
-
|
269
|
-
include Gooby::TestHelper
|
270
|
-
|
271
|
-
@debug = false
|
272
42
|
|
273
|
-
|
274
|
-
|
275
|
-
def test_class_CounterHash
|
43
|
+
def test_class_CounterHash_increment
|
276
44
|
|
277
|
-
|
45
|
+
ctr_hash = Gooby::CounterHash.new
|
46
|
+
33.times { ctr_hash.increment("33") }
|
47
|
+
123.times { ctr_hash.increment("123") }
|
48
|
+
assert(ctr_hash.value('33') == 33, "incremented value not 33.")
|
49
|
+
assert(ctr_hash.value('123') == 123, "incremented value not 123.")
|
50
|
+
assert(ctr_hash.sorted_keys.size == 2, "sorted_keys size is not 2.")
|
278
51
|
end
|
279
52
|
|
280
|
-
def
|
53
|
+
def test_class_CounterHash_increment_tokens
|
281
54
|
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
assert(
|
286
|
-
assert(
|
287
|
-
assert(
|
55
|
+
ctr_hash = Gooby::CounterHash.new
|
56
|
+
ctr_hash.increment_tokens("gooby ruby perl java cobol smalltalk")
|
57
|
+
ctr_hash.increment_tokens("gooby ruby")
|
58
|
+
assert(ctr_hash.value('ruby') == 2, "increment_tokens value of ruby is not 2.")
|
59
|
+
assert(ctr_hash.value('cobol') == 1, "increment_tokens value of cobol is not 1.")
|
60
|
+
assert(ctr_hash.value('vb') == 0, "increment_tokens value of vb is not 0.")
|
288
61
|
end
|
289
62
|
|
290
|
-
def
|
63
|
+
def test_class_CounterHash_initialize
|
291
64
|
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
assert(cHash.value('33') == 33, "incremented value not 33.")
|
296
|
-
assert(cHash.value('123') == 123, "incremented value not 123.")
|
297
|
-
assert(cHash.sorted_keys.size == 2, "sorted_keys size is not 2.")
|
65
|
+
ctr_hash = Gooby::CounterHash.new
|
66
|
+
assert(ctr_hash.value('test') == 0, "initial value is not 0.")
|
67
|
+
assert(ctr_hash.sorted_keys.size == 0, "sorted_keys size is not 0.")
|
298
68
|
end
|
299
69
|
|
300
|
-
def
|
70
|
+
def test_class_CounterHash_size
|
301
71
|
|
302
|
-
|
303
|
-
assert(
|
304
|
-
|
72
|
+
ctr_hash = Gooby::CounterHash.new
|
73
|
+
assert(ctr_hash.size == 0, "initial ctr_hash size is not 0.")
|
74
|
+
ctr_hash.increment("a")
|
75
|
+
ctr_hash.increment_tokens("a b c")
|
76
|
+
assert(ctr_hash.size == 3, "ctr_hash size is not 3.")
|
305
77
|
end
|
306
78
|
|
307
79
|
def test_class_CounterHash_sorted_keys
|
308
80
|
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
array =
|
81
|
+
ctr_hash = Gooby::CounterHash.new
|
82
|
+
ctr_hash.increment('OS/X')
|
83
|
+
ctr_hash.decrement('Windows')
|
84
|
+
ctr_hash.increment('Linux')
|
85
|
+
array = ctr_hash.sorted_keys
|
314
86
|
assert(array.class == Array, "sorted_keys is not an Array; #{array.class}.")
|
315
|
-
assert(
|
87
|
+
assert(ctr_hash.sorted_keys.size == 3, "sorted_keys size is not 3.")
|
316
88
|
assert(array[0] == 'Linux', "sorted_keys element 0 is incorrect.")
|
317
89
|
assert(array[1] == 'OS/X', "sorted_keys element 1 is incorrect.")
|
318
|
-
assert(array[2] == 'Windows', "sorted_keys element 2 is incorrect.")
|
90
|
+
assert(array[2] == 'Windows', "sorted_keys element 2 is incorrect.")
|
319
91
|
end
|
320
92
|
|
321
93
|
def test_class_CounterHash_to_s
|
322
94
|
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
actual = cHash.to_s
|
95
|
+
ctr_hash = Gooby::CounterHash.new
|
96
|
+
ctr_hash.increment("romeo")
|
97
|
+
ctr_hash.increment("maybelline")
|
98
|
+
ctr_hash.decrement("romeo")
|
99
|
+
ctr_hash.increment("yingling")
|
100
|
+
ctr_hash.increment("maybelline")
|
101
|
+
ctr_hash.decrement("domino")
|
102
|
+
ctr_hash.increment("yingling")
|
103
|
+
ctr_hash.increment("maybelline")
|
104
|
+
ctr_hash.increment("leppie")
|
105
|
+
expected = "CHash: key: [domino] val: [-1]\n key: [leppie] val: [1]\n key: [maybelline] val: [3]\n key: [romeo] val: [0]\n key: [yingling] val: [2]\n"
|
106
|
+
actual = ctr_hash.to_s
|
336
107
|
assert_equal(expected, actual, "to_s value is not as expected; #{actual} vs #{expected}")
|
337
108
|
end
|
338
109
|
|
339
110
|
def test_class_CounterHash_to_xml
|
340
111
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
112
|
+
ctr_hash = Gooby::CounterHash.new
|
113
|
+
ctr_hash.increment("romeo")
|
114
|
+
ctr_hash.increment("maybelline")
|
115
|
+
ctr_hash.decrement("romeo")
|
116
|
+
ctr_hash.increment("yingling")
|
117
|
+
ctr_hash.increment("maybelline")
|
118
|
+
ctr_hash.decrement("domino")
|
119
|
+
ctr_hash.increment("yingling")
|
120
|
+
ctr_hash.increment("maybelline")
|
121
|
+
ctr_hash.increment("leppie")
|
351
122
|
|
352
123
|
expected = "<CHash> <entry key='domino' value='-1'/> <entry key='leppie' value='1'/> <entry key='maybelline' value='3'/> <entry key='romeo' value='0'/> <entry key='yingling' value='2'/> </CHash>"
|
353
|
-
actual =
|
124
|
+
actual = ctr_hash.to_xml(false)
|
354
125
|
assert_equal(expected, actual, "to_xml value is not as expected; #{actual} vs #{expected}")
|
355
126
|
end
|
356
127
|
|
@@ -358,15 +129,6 @@ class TestClassCounterHash < Test::Unit::TestCase
|
|
358
129
|
|
359
130
|
# This method is tested in the other test methods.
|
360
131
|
end
|
361
|
-
end
|
362
|
-
|
363
|
-
class TestClassDelimLine < Test::Unit::TestCase
|
364
|
-
|
365
|
-
include Gooby::TestHelper
|
366
|
-
|
367
|
-
@debug = false
|
368
|
-
|
369
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
370
132
|
|
371
133
|
def test_class_DelimLine
|
372
134
|
|
@@ -420,17 +182,11 @@ class TestClassDelimLine < Test::Unit::TestCase
|
|
420
182
|
|
421
183
|
def test_class_DelimLine_to_s
|
422
184
|
|
185
|
+
dline = Gooby::DelimLine.new('# this is a comment line')
|
186
|
+
actual = dline.to_s
|
187
|
+
expected = 'DelimLine: length: 24 trim: true delim: | tokens: 1'
|
188
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
423
189
|
end
|
424
|
-
end
|
425
|
-
|
426
|
-
class TestClassDtTm < Test::Unit::TestCase
|
427
|
-
|
428
|
-
include Gooby::TestHelper
|
429
|
-
include Gooby::Con
|
430
|
-
|
431
|
-
@debug = false
|
432
|
-
|
433
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
434
190
|
|
435
191
|
def test_class_DtTm
|
436
192
|
|
@@ -476,13 +232,6 @@ class TestClassDtTm < Test::Unit::TestCase
|
|
476
232
|
|
477
233
|
end
|
478
234
|
|
479
|
-
# Warning: possible obsolete test method - test_class_DtTm_parse
|
480
|
-
|
481
|
-
def test_class_DtTm_parse
|
482
|
-
|
483
|
-
# This method is tested in the other test methods.
|
484
|
-
end
|
485
|
-
|
486
235
|
def test_class_DtTm_print_string
|
487
236
|
|
488
237
|
dt = Gooby::DtTm.new('2007-02-01T02:13:52Z')
|
@@ -541,29 +290,10 @@ class TestClassDtTm < Test::Unit::TestCase
|
|
541
290
|
expected = "2007-02-01 02:13:52"
|
542
291
|
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
543
292
|
end
|
544
|
-
end
|
545
|
-
|
546
|
-
class TestClassDuration < Test::Unit::TestCase
|
547
|
-
|
548
|
-
include Gooby::TestHelper
|
549
|
-
include Gooby::Con
|
550
|
-
|
551
|
-
@debug = false
|
552
|
-
|
553
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
554
293
|
|
555
294
|
def test_class_Duration
|
556
295
|
|
557
|
-
|
558
|
-
s1a = d1.to_s
|
559
|
-
s1b = d1.print_string
|
560
|
-
actual = s1a
|
561
|
-
expected = '08:27.87'
|
562
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
563
|
-
|
564
|
-
actual = s1b
|
565
|
-
expected = 'Duration: 507.870 sec: 507.87 min: 8.4645 mmss: 08:27.87 bm: 8 fm: 0.464499999999999 fs: 27.87'
|
566
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
296
|
+
# This class is tested in the methods below.
|
567
297
|
end
|
568
298
|
|
569
299
|
def test_class_Duration_initialize
|
@@ -572,6 +302,10 @@ class TestClassDuration < Test::Unit::TestCase
|
|
572
302
|
|
573
303
|
def test_class_Duration_print_string
|
574
304
|
|
305
|
+
d1 = Gooby::Duration.new('PT507.870S')
|
306
|
+
actual = d1.print_string
|
307
|
+
expected = 'Duration: 507.870 sec: 507.87 min: 8.4645 mmss: 08:27.87 bm: 8 fm: 0.464499999999999 fs: 27.87'
|
308
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
575
309
|
end
|
576
310
|
|
577
311
|
def test_class_Duration_scrub
|
@@ -580,16 +314,11 @@ class TestClassDuration < Test::Unit::TestCase
|
|
580
314
|
|
581
315
|
def test_class_Duration_to_s
|
582
316
|
|
317
|
+
d1 = Gooby::Duration.new('PT507.870S')
|
318
|
+
actual = d1.to_s
|
319
|
+
expected = '08:27.87'
|
320
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
583
321
|
end
|
584
|
-
end
|
585
|
-
|
586
|
-
class TestClassForerunnerXmlParser < Test::Unit::TestCase
|
587
|
-
|
588
|
-
include Gooby::TestHelper
|
589
|
-
|
590
|
-
@debug = false
|
591
|
-
|
592
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
593
322
|
|
594
323
|
def test_class_ForerunnerXmlParser
|
595
324
|
|
@@ -635,97 +364,189 @@ class TestClassForerunnerXmlParser < Test::Unit::TestCase
|
|
635
364
|
|
636
365
|
end
|
637
366
|
|
638
|
-
|
367
|
+
def test_class_ForerunnerXmlSplitter
|
639
368
|
|
640
|
-
|
369
|
+
end
|
370
|
+
|
371
|
+
def test_class_ForerunnerXmlSplitter_end_run
|
641
372
|
|
642
373
|
end
|
643
|
-
end
|
644
374
|
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
@debug = false
|
375
|
+
def test_class_ForerunnerXmlSplitter_initialize
|
376
|
+
|
377
|
+
end
|
650
378
|
|
651
|
-
|
379
|
+
def test_class_ForerunnerXmlSplitter_process_file
|
652
380
|
|
653
|
-
|
381
|
+
end
|
654
382
|
|
655
|
-
def
|
383
|
+
def test_class_ForerunnerXmlSplitter_split
|
656
384
|
|
657
385
|
end
|
658
|
-
end
|
659
386
|
|
660
|
-
|
661
|
-
|
662
|
-
include Gooby::TestHelper
|
663
|
-
|
664
|
-
@debug = false
|
387
|
+
def test_class_ForerunnerXmlSplitter_write_files
|
665
388
|
|
666
|
-
|
389
|
+
end
|
667
390
|
|
668
|
-
def
|
391
|
+
def test_class_GeoData
|
669
392
|
|
670
393
|
end
|
671
394
|
|
672
|
-
def
|
395
|
+
def test_class_GeoData_add_poi
|
673
396
|
|
674
397
|
end
|
675
398
|
|
676
|
-
def
|
399
|
+
def test_class_GeoData_add_route
|
677
400
|
|
678
401
|
end
|
679
402
|
|
680
|
-
def
|
403
|
+
def test_class_GeoData_add_track
|
681
404
|
|
682
405
|
end
|
683
406
|
|
684
|
-
def
|
407
|
+
def test_class_GeoData_dump
|
685
408
|
|
686
409
|
end
|
687
410
|
|
688
|
-
|
411
|
+
def test_class_GeoData_initialize
|
412
|
+
|
413
|
+
end
|
689
414
|
|
690
|
-
def
|
415
|
+
def test_class_GeoData_parse_poi
|
691
416
|
|
692
417
|
end
|
693
|
-
end
|
694
418
|
|
695
|
-
|
696
|
-
|
697
|
-
include Gooby::TestHelper
|
698
|
-
|
699
|
-
@debug = false
|
419
|
+
def test_class_GeoData_parse_routes
|
700
420
|
|
701
|
-
|
421
|
+
end
|
702
422
|
|
703
|
-
def
|
423
|
+
def test_class_GeoData_parse_tracks
|
704
424
|
|
705
425
|
end
|
706
426
|
|
707
|
-
def
|
427
|
+
def test_class_GeoData_to_s
|
708
428
|
|
709
429
|
end
|
710
430
|
|
711
|
-
def
|
431
|
+
def test_class_GoobyCommand
|
712
432
|
|
713
433
|
end
|
714
434
|
|
715
|
-
|
435
|
+
def test_class_GoobyCommand_generate_google_map
|
436
|
+
|
437
|
+
end
|
716
438
|
|
717
|
-
def
|
439
|
+
def test_class_GoobyCommand_initialize
|
718
440
|
|
719
441
|
end
|
720
|
-
end
|
721
442
|
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
443
|
+
def test_class_GoobyCommand_options
|
444
|
+
|
445
|
+
end
|
446
|
+
|
447
|
+
def test_class_GoobyCommand_parse_garmin_forerunner_logbook_xml
|
448
|
+
|
449
|
+
end
|
450
|
+
|
451
|
+
def test_class_GoobyCommand_parse_garmin_training_center_xml
|
452
|
+
|
453
|
+
end
|
454
|
+
|
455
|
+
def test_class_GoobyCommand_split_garmin_forerunner_logbook_xml
|
456
|
+
|
457
|
+
end
|
458
|
+
|
459
|
+
def test_class_GoobyCommand_split_garmin_training_center_xml
|
460
|
+
|
461
|
+
end
|
462
|
+
|
463
|
+
def test_class_GoogleMapGenerator
|
464
|
+
|
465
|
+
end
|
466
|
+
|
467
|
+
def test_class_GoogleMapGenerator_compute_center_point
|
468
|
+
|
469
|
+
end
|
470
|
+
|
471
|
+
def test_class_GoogleMapGenerator_filter_trackpoints
|
472
|
+
|
473
|
+
end
|
474
|
+
|
475
|
+
def test_class_GoogleMapGenerator_generate
|
476
|
+
|
477
|
+
end
|
478
|
+
|
479
|
+
def test_class_GoogleMapGenerator_generate_key_js
|
480
|
+
|
481
|
+
end
|
482
|
+
|
483
|
+
def test_class_GoogleMapGenerator_generate_main_js_checkpoint_overlays
|
484
|
+
|
485
|
+
end
|
486
|
+
|
487
|
+
def test_class_GoogleMapGenerator_generate_main_js_end
|
488
|
+
|
489
|
+
end
|
490
|
+
|
491
|
+
def test_class_GoogleMapGenerator_generate_main_js_map_clicked_listeners
|
492
|
+
|
493
|
+
end
|
494
|
+
|
495
|
+
def test_class_GoogleMapGenerator_generate_main_js_route_overlay
|
496
|
+
|
497
|
+
end
|
498
|
+
|
499
|
+
def test_class_GoogleMapGenerator_generate_main_js_start
|
500
|
+
|
501
|
+
end
|
502
|
+
|
503
|
+
def test_class_GoogleMapGenerator_generate_map_div
|
504
|
+
|
505
|
+
end
|
506
|
+
|
507
|
+
def test_class_GoogleMapGenerator_generate_messages_div
|
508
|
+
|
509
|
+
end
|
510
|
+
|
511
|
+
def test_class_GoogleMapGenerator_generate_page
|
512
|
+
|
513
|
+
end
|
514
|
+
|
515
|
+
def test_class_GoogleMapGenerator_initialize
|
516
|
+
|
517
|
+
end
|
518
|
+
|
519
|
+
def test_class_History
|
520
|
+
|
521
|
+
end
|
522
|
+
|
523
|
+
def test_class_History_add_run
|
524
|
+
|
525
|
+
end
|
526
|
+
|
527
|
+
def test_class_History_initialize
|
528
|
+
|
529
|
+
end
|
530
|
+
|
531
|
+
def test_class_History_print_string
|
532
|
+
|
533
|
+
end
|
534
|
+
|
535
|
+
def test_class_History_to_s
|
536
|
+
|
537
|
+
end
|
538
|
+
|
539
|
+
def test_class_Lap
|
540
|
+
|
541
|
+
end
|
542
|
+
|
543
|
+
def test_class_Lap_initialize
|
727
544
|
|
728
|
-
|
545
|
+
end
|
546
|
+
|
547
|
+
def test_class_Lap_to_s
|
548
|
+
|
549
|
+
end
|
729
550
|
|
730
551
|
def test_class_Line
|
731
552
|
|
@@ -797,34 +618,43 @@ class TestClassLine < Test::Unit::TestCase
|
|
797
618
|
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
798
619
|
end
|
799
620
|
|
800
|
-
|
621
|
+
def test_class_Options
|
622
|
+
|
623
|
+
end
|
801
624
|
|
802
|
-
def
|
625
|
+
def test_class_Options_get
|
803
626
|
|
804
|
-
|
805
|
-
actual =
|
806
|
-
expected =
|
807
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
808
|
-
|
809
|
-
line = Gooby::Line.new('heck no')
|
810
|
-
actual = line.is_populated_non_comment
|
811
|
-
expected = true
|
627
|
+
options = Gooby::Options.new(nil)
|
628
|
+
actual = options.get('gmap_icon_url_base')
|
629
|
+
expected = 'http://www.joakim-systems.com/gicons/'
|
812
630
|
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
631
|
+
|
632
|
+
actual = options.get('nope, not there')
|
633
|
+
expected = ''
|
634
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
635
|
+
end
|
813
636
|
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
637
|
+
def test_class_Options_initialize
|
638
|
+
|
639
|
+
options = Gooby::Options.new(nil)
|
640
|
+
size = options.size
|
641
|
+
assert(size > 0, "size is not > 0; #{size}")
|
818
642
|
end
|
819
|
-
end
|
820
643
|
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
644
|
+
def test_class_Options_size
|
645
|
+
|
646
|
+
options = Gooby::Options.new(nil)
|
647
|
+
size = options.size
|
648
|
+
assert(size > 0, "size is not > 0; #{size}")
|
649
|
+
end
|
826
650
|
|
827
|
-
|
651
|
+
def test_class_Options_to_s
|
652
|
+
|
653
|
+
options = Gooby::Options.new(nil)
|
654
|
+
actual = options.to_s
|
655
|
+
expected = 'Options: filename: gooby_options.yaml entries: 23'
|
656
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
657
|
+
end
|
828
658
|
|
829
659
|
def test_class_Position
|
830
660
|
|
@@ -871,15 +701,6 @@ class TestClassPosition < Test::Unit::TestCase
|
|
871
701
|
expected = 'lat: 35.49910 lng: -80.83695 alt: 220.279 note: '
|
872
702
|
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
873
703
|
end
|
874
|
-
end
|
875
|
-
|
876
|
-
class TestClassRun < Test::Unit::TestCase
|
877
|
-
|
878
|
-
include Gooby::TestHelper
|
879
|
-
|
880
|
-
@debug = false
|
881
|
-
|
882
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
883
704
|
|
884
705
|
def test_class_Run
|
885
706
|
|
@@ -893,12 +714,6 @@ class TestClassRun < Test::Unit::TestCase
|
|
893
714
|
|
894
715
|
end
|
895
716
|
|
896
|
-
# Warning: possible obsolete test method - test_class_Run_compute_center_point
|
897
|
-
|
898
|
-
def test_class_Run_compute_center_point
|
899
|
-
|
900
|
-
end
|
901
|
-
|
902
717
|
def test_class_Run_compute_distance_and_pace
|
903
718
|
|
904
719
|
end
|
@@ -919,40 +734,10 @@ class TestClassRun < Test::Unit::TestCase
|
|
919
734
|
|
920
735
|
end
|
921
736
|
|
922
|
-
# Warning: possible obsolete test method - test_class_Run_filter_trackpoints
|
923
|
-
|
924
|
-
def test_class_Run_filter_trackpoints
|
925
|
-
|
926
|
-
end
|
927
|
-
|
928
737
|
def test_class_Run_finish
|
929
738
|
|
930
739
|
end
|
931
740
|
|
932
|
-
# Warning: possible obsolete test method - test_class_Run_generate_gmap_info
|
933
|
-
|
934
|
-
def test_class_Run_generate_gmap_info
|
935
|
-
|
936
|
-
end
|
937
|
-
|
938
|
-
# Warning: possible obsolete test method - test_class_Run_generate_gpoint_array
|
939
|
-
|
940
|
-
def test_class_Run_generate_gpoint_array
|
941
|
-
|
942
|
-
end
|
943
|
-
|
944
|
-
# Warning: possible obsolete test method - test_class_Run_generate_key_js
|
945
|
-
|
946
|
-
def test_class_Run_generate_key_js
|
947
|
-
|
948
|
-
end
|
949
|
-
|
950
|
-
# Warning: possible obsolete test method - test_class_Run_generate_overlay_points
|
951
|
-
|
952
|
-
def test_class_Run_generate_overlay_points
|
953
|
-
|
954
|
-
end
|
955
|
-
|
956
741
|
def test_class_Run_initialize
|
957
742
|
|
958
743
|
end
|
@@ -997,21 +782,6 @@ class TestClassRun < Test::Unit::TestCase
|
|
997
782
|
|
998
783
|
end
|
999
784
|
|
1000
|
-
# Warning: possible obsolete test method - test_stub
|
1001
|
-
|
1002
|
-
def test_stub
|
1003
|
-
|
1004
|
-
end
|
1005
|
-
end
|
1006
|
-
|
1007
|
-
class TestClassSimpleXmlParser < Test::Unit::TestCase
|
1008
|
-
|
1009
|
-
include Gooby::TestHelper
|
1010
|
-
|
1011
|
-
@debug = false
|
1012
|
-
|
1013
|
-
### Start of tests. Keep this line - see class TestGenerator.
|
1014
|
-
|
1015
785
|
def test_class_SimpleXmlParser
|
1016
786
|
|
1017
787
|
end
|
@@ -1036,202 +806,304 @@ class TestClassSimpleXmlParser < Test::Unit::TestCase
|
|
1036
806
|
|
1037
807
|
end
|
1038
808
|
|
1039
|
-
|
809
|
+
def test_class_Track
|
810
|
+
|
811
|
+
end
|
1040
812
|
|
1041
|
-
def
|
813
|
+
def test_class_Track_add_trackpoint
|
1042
814
|
|
1043
815
|
end
|
1044
|
-
end
|
1045
816
|
|
1046
|
-
|
1047
|
-
|
1048
|
-
include Gooby::TestHelper
|
1049
|
-
|
1050
|
-
@debug = false
|
817
|
+
def test_class_Track_dump
|
1051
818
|
|
1052
|
-
|
819
|
+
end
|
1053
820
|
|
1054
|
-
def
|
821
|
+
def test_class_Track_initialize
|
1055
822
|
|
1056
823
|
end
|
1057
824
|
|
1058
|
-
def
|
825
|
+
def test_class_Track_size
|
1059
826
|
|
1060
827
|
end
|
1061
828
|
|
1062
|
-
def
|
829
|
+
def test_class_Track_to_s
|
1063
830
|
|
1064
831
|
end
|
1065
832
|
|
1066
|
-
|
833
|
+
def test_class_Trackpoint
|
834
|
+
|
835
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
836
|
+
end
|
1067
837
|
|
1068
|
-
def
|
838
|
+
def test_class_Trackpoint_as_glatlng
|
1069
839
|
|
1070
840
|
end
|
1071
841
|
|
1072
|
-
def
|
842
|
+
def test_class_Trackpoint_as_info_window_html
|
1073
843
|
|
1074
844
|
end
|
1075
845
|
|
1076
|
-
def
|
846
|
+
def test_class_Trackpoint_compute_cumulative_pace
|
1077
847
|
|
1078
848
|
end
|
1079
849
|
|
1080
|
-
|
850
|
+
def test_class_Trackpoint_compute_distance_and_pace
|
851
|
+
|
852
|
+
end
|
1081
853
|
|
1082
|
-
def
|
854
|
+
def test_class_Trackpoint_deg2rad
|
1083
855
|
|
1084
856
|
end
|
1085
857
|
|
1086
|
-
def
|
858
|
+
def test_class_Trackpoint_initialize
|
1087
859
|
|
1088
860
|
end
|
1089
861
|
|
1090
|
-
def
|
862
|
+
def test_class_Trackpoint_is_split
|
1091
863
|
|
1092
864
|
end
|
1093
865
|
|
1094
|
-
def
|
866
|
+
def test_class_Trackpoint_position
|
1095
867
|
|
1096
868
|
end
|
1097
869
|
|
1098
|
-
|
870
|
+
def test_class_Trackpoint_rad2deg
|
871
|
+
|
872
|
+
end
|
1099
873
|
|
1100
|
-
def
|
874
|
+
def test_class_Trackpoint_set_split
|
1101
875
|
|
1102
876
|
end
|
1103
|
-
end
|
1104
877
|
|
1105
|
-
|
1106
|
-
|
1107
|
-
include Gooby::TestHelper
|
1108
|
-
|
1109
|
-
@debug = false
|
878
|
+
def test_class_Trackpoint_split_info
|
1110
879
|
|
1111
|
-
|
880
|
+
end
|
1112
881
|
|
1113
|
-
def
|
882
|
+
def test_class_Trackpoint_to_csv
|
1114
883
|
|
1115
884
|
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
885
|
+
actual = tkpt.to_csv
|
886
|
+
expected = '0 | 2007-02-01T02:13:52Z | 1 | 35.49910 | -80.83695 | 220.279 | 0.0 '
|
887
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1116
888
|
end
|
1117
889
|
|
1118
|
-
|
890
|
+
def test_class_Trackpoint_to_geo_s
|
891
|
+
|
892
|
+
end
|
1119
893
|
|
1120
|
-
def
|
894
|
+
def test_class_Trackpoint_to_s
|
1121
895
|
|
1122
896
|
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
1123
|
-
actual
|
1124
|
-
expected = 220.279
|
897
|
+
actual = tkpt.to_s
|
898
|
+
expected = 'Tkpt: 1 lat: 35.49910 lng: -80.83695 alt: 220.279 note: date: 2007-02-01T02:13:52Z cdist: 0.0'
|
1125
899
|
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1126
900
|
end
|
1127
901
|
|
1128
|
-
def
|
902
|
+
def test_class_TrainingCenterXmlParser
|
1129
903
|
|
1130
904
|
end
|
1131
905
|
|
1132
|
-
def
|
906
|
+
def test_class_TrainingCenterXmlParser_detail_tag?
|
1133
907
|
|
1134
908
|
end
|
1135
909
|
|
1136
|
-
|
910
|
+
def test_class_TrainingCenterXmlParser_dump
|
911
|
+
|
912
|
+
end
|
1137
913
|
|
1138
|
-
def
|
914
|
+
def test_class_TrainingCenterXmlParser_gdump
|
1139
915
|
|
1140
916
|
end
|
1141
917
|
|
1142
|
-
|
918
|
+
def test_class_TrainingCenterXmlParser_initialize
|
919
|
+
|
920
|
+
end
|
1143
921
|
|
1144
|
-
def
|
922
|
+
def test_class_TrainingCenterXmlParser_is_tag?
|
1145
923
|
|
1146
924
|
end
|
1147
925
|
|
1148
|
-
|
926
|
+
def test_class_TrainingCenterXmlParser_put_all_run_tkpt_csv
|
927
|
+
|
928
|
+
end
|
1149
929
|
|
1150
|
-
def
|
930
|
+
def test_class_TrainingCenterXmlParser_put_run_csv
|
1151
931
|
|
1152
932
|
end
|
1153
933
|
|
1154
|
-
def
|
934
|
+
def test_class_TrainingCenterXmlParser_tag_end
|
1155
935
|
|
1156
936
|
end
|
1157
937
|
|
1158
|
-
def
|
938
|
+
def test_class_TrainingCenterXmlParser_tag_start
|
1159
939
|
|
1160
940
|
end
|
1161
941
|
|
1162
|
-
def
|
942
|
+
def test_class_TrainingCenterXmlParser_text
|
1163
943
|
|
1164
944
|
end
|
1165
945
|
|
1166
|
-
def
|
946
|
+
def test_class_TrainingCenterXmlSplitter
|
1167
947
|
|
1168
948
|
end
|
1169
949
|
|
1170
|
-
def
|
950
|
+
def test_class_TrainingCenterXmlSplitter_end_run
|
1171
951
|
|
1172
952
|
end
|
1173
953
|
|
1174
|
-
def
|
954
|
+
def test_class_TrainingCenterXmlSplitter_initialize
|
1175
955
|
|
1176
956
|
end
|
1177
957
|
|
1178
|
-
def
|
958
|
+
def test_class_TrainingCenterXmlSplitter_process_file
|
1179
959
|
|
1180
960
|
end
|
1181
961
|
|
1182
|
-
|
962
|
+
def test_class_TrainingCenterXmlSplitter_split
|
1183
963
|
|
1184
|
-
|
964
|
+
end
|
1185
965
|
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
966
|
+
def test_class_TrainingCenterXmlSplitter_write_files
|
967
|
+
|
968
|
+
end
|
969
|
+
|
970
|
+
def test_module_GoobyKernel
|
971
|
+
|
972
|
+
fn = 'data/test1.txt'
|
973
|
+
obj = Gooby::GoobyObject.new
|
974
|
+
a1 = obj.read_lines(fn, false)
|
975
|
+
a2 = obj.read_lines(fn, true)
|
976
|
+
a3 = obj.read_as_ascii_lines(fn, 10, false)
|
977
|
+
|
978
|
+
puts '' if @debug
|
979
|
+
a1.each { |line| puts line } if @debug
|
980
|
+
a2.each { |line| puts line } if @debug
|
981
|
+
a3.each { |line| puts line } if @debug
|
982
|
+
|
983
|
+
assert_equal('This is just a file', a2[0], "a2[0] is not as expected.")
|
984
|
+
assert_equal('This is just a file', a3[0], "a3[0] is not as expected.")
|
985
|
+
assert_equal('test data.', a2[3], "a2[1] is not as expected.")
|
986
|
+
assert_equal(' test data.', a3[3], "a3[3] is not as expected.")
|
987
|
+
|
988
|
+
puts "todo: implement #{name}" if @debug
|
1190
989
|
end
|
1191
990
|
|
1192
|
-
|
991
|
+
def test_module_GoobyKernel_default_delimiter
|
992
|
+
|
993
|
+
obj = Gooby::GoobyObject.new
|
994
|
+
actual = obj.default_delimiter
|
995
|
+
expected = '|'
|
996
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
997
|
+
end
|
1193
998
|
|
1194
|
-
def
|
999
|
+
def test_module_GoobyKernel_invalid_altitude
|
1195
1000
|
|
1196
|
-
|
1197
|
-
actual
|
1198
|
-
expected = -
|
1199
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1001
|
+
obj = Gooby::GoobyObject.new
|
1002
|
+
actual = obj.invalid_altitude
|
1003
|
+
expected = -1
|
1004
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1200
1005
|
end
|
1201
1006
|
|
1202
|
-
def
|
1007
|
+
def test_module_GoobyKernel_invalid_latitude
|
1008
|
+
|
1009
|
+
obj = Gooby::GoobyObject.new
|
1010
|
+
actual = obj.invalid_latitude
|
1011
|
+
expected = -1
|
1012
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1013
|
+
end
|
1203
1014
|
|
1015
|
+
def test_module_GoobyKernel_invalid_longitude
|
1016
|
+
|
1017
|
+
obj = Gooby::GoobyObject.new
|
1018
|
+
actual = obj.invalid_longitude
|
1019
|
+
expected = -1
|
1020
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1204
1021
|
end
|
1205
1022
|
|
1206
|
-
def
|
1023
|
+
def test_module_GoobyKernel_invalid_time
|
1024
|
+
|
1025
|
+
obj = Gooby::GoobyObject.new
|
1026
|
+
actual = obj.invalid_time
|
1027
|
+
expected = -99999999
|
1028
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
def test_module_GoobyKernel_project_author
|
1207
1032
|
|
1033
|
+
obj = Gooby::GoobyObject.new
|
1208
1034
|
end
|
1209
1035
|
|
1210
|
-
def
|
1036
|
+
def test_module_GoobyKernel_project_copyright
|
1211
1037
|
|
1212
1038
|
end
|
1213
1039
|
|
1214
|
-
def
|
1040
|
+
def test_module_GoobyKernel_project_date
|
1215
1041
|
|
1042
|
+
obj = Gooby::GoobyObject.new
|
1043
|
+
assert_equal '2007/03/15', obj.project_date
|
1216
1044
|
end
|
1217
1045
|
|
1218
|
-
def
|
1046
|
+
def test_module_GoobyKernel_project_license
|
1219
1047
|
|
1220
|
-
|
1221
|
-
|
1222
|
-
expected = '0 | 2007-02-01T02:13:52Z | 1 | 35.49910 | -80.83695 | 220.279 | 0.0 '
|
1223
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1048
|
+
obj = Gooby::GoobyObject.new
|
1049
|
+
assert_equal 'GNU General Public License (GPL). See http://www.gnu.org/copyleft/gpl.html', obj.project_license
|
1224
1050
|
end
|
1225
1051
|
|
1226
|
-
def
|
1052
|
+
def test_module_GoobyKernel_project_version_number
|
1227
1053
|
|
1054
|
+
obj = Gooby::GoobyObject.new
|
1055
|
+
assert_equal '0.9.5', obj.project_version_number
|
1228
1056
|
end
|
1229
1057
|
|
1230
|
-
def
|
1058
|
+
def test_module_GoobyKernel_project_year
|
1231
1059
|
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1060
|
+
obj = Gooby::GoobyObject.new
|
1061
|
+
assert_equal '2007', obj.project_year
|
1062
|
+
end
|
1063
|
+
|
1064
|
+
def test_module_GoobyKernel_read_as_ascii_lines
|
1065
|
+
|
1066
|
+
end
|
1067
|
+
|
1068
|
+
def test_module_GoobyKernel_read_lines
|
1069
|
+
|
1070
|
+
end
|
1071
|
+
|
1072
|
+
def test_module_GoobyKernel_strip_lines
|
1073
|
+
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
def test_module_GoobyKernel_tokenize
|
1077
|
+
|
1078
|
+
obj = Gooby::GoobyObject.new
|
1079
|
+
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
1080
|
+
array = obj.tokenize(s, nil)
|
1081
|
+
actual = array.size
|
1082
|
+
expected = 8
|
1083
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1084
|
+
|
1085
|
+
actual = array[1]
|
1086
|
+
expected = '-80.83214521408081'
|
1087
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1088
|
+
|
1089
|
+
actual = array[6]
|
1090
|
+
expected = 'Way'
|
1091
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1092
|
+
|
1093
|
+
obj = Gooby::GoobyObject.new
|
1094
|
+
s = 'twain , faulkner, wolfe, caldwell '
|
1095
|
+
array = obj.tokenize(s, ',', false)
|
1096
|
+
|
1097
|
+
actual = array.size
|
1098
|
+
expected = 4
|
1099
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1100
|
+
|
1101
|
+
actual = array[0]
|
1102
|
+
expected = 'twain '
|
1103
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1104
|
+
|
1105
|
+
actual = array[3]
|
1106
|
+
expected = ' caldwell '
|
1235
1107
|
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1236
1108
|
end
|
1237
1109
|
end
|