gooby 1.0.0 → 1.1.0
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.
- data/README +144 -180
- data/bin/example_usage.txt +55 -0
- data/bin/gooby_been_there.rb +35 -0
- data/bin/gooby_config.rb +16 -0
- data/bin/gooby_gen_gmap.rb +16 -0
- data/bin/gooby_parser.rb +19 -0
- data/bin/gooby_splitter.rb +18 -0
- data/bin/gooby_version.rb +16 -0
- data/bin/run_all.sh +23 -0
- data/bin/run_been_there.sh +16 -0
- data/bin/run_db_gen.sh +11 -0
- data/bin/run_db_load.sh +11 -0
- data/bin/run_gen_gmaps.sh +20 -0
- data/bin/run_parse.sh +43 -0
- data/bin/run_parse_named.sh +19 -0
- data/bin/run_split.sh +23 -0
- data/config/gooby_config.yaml +137 -0
- data/data/20050305_corporate_cup_hm.csv +251 -251
- data/data/20050430_nashville_marathon.csv +1208 -1208
- data/data/20060115_phoenix_marathon.csv +1280 -1280
- data/data/davidson_11m_20070101.csv +251 -0
- data/data/davidson_11m_20070101.xml +2020 -0
- data/data/davidson_5K_20070505.csv +286 -0
- data/data/davidson_5K_20070505.xml +2875 -0
- data/lib/gooby.rb +889 -361
- data/samples/20050305_corporate_cup_hm.html +270 -270
- data/samples/20050430_nashville_marathon.html +1240 -1240
- data/samples/20060115_phoenix_marathon.html +1312 -1312
- data/samples/been_there.txt +744 -0
- data/samples/davidson_11m_20070101.html +432 -0
- data/samples/davidson_5K_20070505.html +395 -0
- data/sql/gooby.ddl +56 -0
- data/sql/gooby_load.dml +35 -0
- metadata +30 -32
- data/bin/20050305_corporate_cup_hm_to_csv.rb +0 -9
- data/bin/20050430_nashville_marathon_to_csv.rb +0 -9
- data/bin/20060115_phoenix_marathon_to_csv.rb +0 -9
- data/bin/activity_2007_03_10_13_02_32.xml_to_csv.rb +0 -9
- data/bin/example_usage.rb +0 -46
- data/bin/example_usage.sh +0 -52
- data/bin/gen_gap_phx.rb +0 -10
- data/bin/gen_gmap_cc_2005.rb +0 -10
- data/bin/gen_gmap_cc_2007.rb +0 -10
- data/bin/gen_gmap_nashville.rb +0 -10
- data/bin/gen_gmap_phx.rb +0 -10
- data/bin/phx_to_csv.rb +0 -47
- data/bin/split_forerunner_logbook_2007.rb +0 -10
- data/bin/split_training_center_2007.rb +0 -8
- data/data/2007_03_10.tcx +0 -28445
- data/data/activity_2007_03_10_13_02_32.csv +0 -1168
- data/data/activity_2007_03_10_13_02_32.xml +0 -11695
- data/data/forerunner_2007.xml +0 -31872
- data/data/geo_data.txt +0 -171
- data/pkg/code_header.txt +0 -21
- data/pkg/pkg.rb +0 -238
- data/pkg/test_header.txt +0 -19
- data/samples/20070310_corporate_cup_hm.html +0 -1367
- data/samples/gps_point_capture.html +0 -54
- data/samples/phoenix_marathon.html +0 -1596
- data/tests/ts_gooby.rb +0 -1109
- data/tests/ts_gooby_min.rb +0 -550
data/tests/ts_gooby.rb
DELETED
@@ -1,1109 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
|
3
|
-
This contains the regression test suite for the Gooby project.
|
4
|
-
|
5
|
-
See file 'lib/gooby.rb' which is the subject of this test suite.
|
6
|
-
|
7
|
-
Gooby - Copyright 2007 by Chris Joakim.
|
8
|
-
Gooby is available under GNU General Public License (GPL) license.
|
9
|
-
=end
|
10
|
-
|
11
|
-
# The following prefixes ../lib to the active ruby load path
|
12
|
-
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
13
|
-
puts '$LOAD_PATH is now:'
|
14
|
-
puts $LOAD_PATH
|
15
|
-
|
16
|
-
require 'gooby'
|
17
|
-
require 'test/unit'
|
18
|
-
|
19
|
-
class TestGoobyKernel < Test::Unit::TestCase
|
20
|
-
|
21
|
-
include Gooby::TestHelper
|
22
|
-
include Gooby::GoobyKernel
|
23
|
-
|
24
|
-
@debug = false
|
25
|
-
|
26
|
-
# beginning of tests - keep this marker
|
27
|
-
|
28
|
-
def test_class_CounterHash
|
29
|
-
|
30
|
-
# See the method-level tests below.
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_class_CounterHash_decrement
|
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.")
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_class_CounterHash_increment
|
44
|
-
|
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.")
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_class_CounterHash_increment_tokens
|
54
|
-
|
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.")
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_class_CounterHash_initialize
|
64
|
-
|
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.")
|
68
|
-
end
|
69
|
-
|
70
|
-
def test_class_CounterHash_size
|
71
|
-
|
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.")
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_class_CounterHash_sorted_keys
|
80
|
-
|
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
|
86
|
-
assert(array.class == Array, "sorted_keys is not an Array; #{array.class}.")
|
87
|
-
assert(ctr_hash.sorted_keys.size == 3, "sorted_keys size is not 3.")
|
88
|
-
assert(array[0] == 'Linux', "sorted_keys element 0 is incorrect.")
|
89
|
-
assert(array[1] == 'OS/X', "sorted_keys element 1 is incorrect.")
|
90
|
-
assert(array[2] == 'Windows', "sorted_keys element 2 is incorrect.")
|
91
|
-
end
|
92
|
-
|
93
|
-
def test_class_CounterHash_to_s
|
94
|
-
|
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
|
107
|
-
assert_equal(expected, actual, "to_s value is not as expected; #{actual} vs #{expected}")
|
108
|
-
end
|
109
|
-
|
110
|
-
def test_class_CounterHash_to_xml
|
111
|
-
|
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")
|
122
|
-
|
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>"
|
124
|
-
actual = ctr_hash.to_xml(false)
|
125
|
-
assert_equal(expected, actual, "to_xml value is not as expected; #{actual} vs #{expected}")
|
126
|
-
end
|
127
|
-
|
128
|
-
def test_class_CounterHash_value
|
129
|
-
|
130
|
-
# This method is tested in the other test methods.
|
131
|
-
end
|
132
|
-
|
133
|
-
def test_class_DelimLine
|
134
|
-
|
135
|
-
line = '1 | 2007-01-01 | 16:38:43 | 1167669523 | 2 | 35.49532 | -80.83167 | 242.870 | 0.0313362638280469 '
|
136
|
-
dline = Gooby::DelimLine.new(line)
|
137
|
-
|
138
|
-
expected = 'DelimLine: length: 101 trim: true delim: | tokens: 9'
|
139
|
-
actual = dline.to_s
|
140
|
-
assert_equal(expected, actual, "to_xml value is not as expected; #{actual} vs #{expected}")
|
141
|
-
|
142
|
-
expected = '1'
|
143
|
-
actual = dline.tokens[0]
|
144
|
-
assert_equal(expected, actual, "to_xml value is not as expected; #{actual} vs #{expected}")
|
145
|
-
|
146
|
-
expected = '16:38:43'
|
147
|
-
actual = dline.tokens[2]
|
148
|
-
assert_equal(expected, actual, "to_xml value is not as expected; #{actual} vs #{expected}")
|
149
|
-
|
150
|
-
expected = '0.0313362638280469'
|
151
|
-
actual = dline.tokens[-1]
|
152
|
-
assert_equal(expected, actual, "to_xml value is not as expected; #{actual} vs #{expected}")
|
153
|
-
end
|
154
|
-
|
155
|
-
def test_class_DelimLine_as_trackpoint
|
156
|
-
|
157
|
-
line = '6 | 2007-01-13T16:35:53Z | 243 | 35.49517 | -80.83215 | 237.583 | 6.51627221396902 '
|
158
|
-
dline = Gooby::DelimLine.new(line)
|
159
|
-
tkpt = dline.as_trackpoint(0, 3, 4, 5, 1) # (numIdx, latIdx, lngIdx, altIdx, timeIdx)
|
160
|
-
end
|
161
|
-
|
162
|
-
def test_class_DelimLine_initialize
|
163
|
-
|
164
|
-
# This method is tested in the other test methods.
|
165
|
-
end
|
166
|
-
|
167
|
-
def test_class_DelimLine_is_comment?
|
168
|
-
|
169
|
-
dline = Gooby::DelimLine.new('# this is a comment line')
|
170
|
-
bool1 = dline.is_comment?
|
171
|
-
|
172
|
-
dline = Gooby::DelimLine.new('this is not a comment line')
|
173
|
-
bool2 = dline.is_comment?
|
174
|
-
|
175
|
-
dline = Gooby::DelimLine.new(' # this is a comment line')
|
176
|
-
bool3 = dline.is_comment?
|
177
|
-
|
178
|
-
assert(bool1 == true, "line 1 should be a comment")
|
179
|
-
assert(bool2 == false, "line 2 not should be a comment")
|
180
|
-
assert(bool3 == true, "line 3 should be a comment")
|
181
|
-
end
|
182
|
-
|
183
|
-
def test_class_DelimLine_to_s
|
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}")
|
189
|
-
end
|
190
|
-
|
191
|
-
def test_class_DtTm
|
192
|
-
|
193
|
-
# This class is tested in the methods below.
|
194
|
-
end
|
195
|
-
|
196
|
-
def test_class_DtTm_hh_mm_ss
|
197
|
-
|
198
|
-
s = '2006-01-15T01:02:00Z'
|
199
|
-
dt = Gooby::DtTm.new(s)
|
200
|
-
actual = dt.hh_mm_ss
|
201
|
-
expected = '01:02:00'
|
202
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
203
|
-
|
204
|
-
s = '2006-01-15T03:41:40Z'
|
205
|
-
dt = Gooby::DtTm.new(s)
|
206
|
-
actual = dt.hh_mm_ss
|
207
|
-
expected = '03:41:40'
|
208
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
209
|
-
end
|
210
|
-
|
211
|
-
def test_class_DtTm_hhmmss_diff
|
212
|
-
|
213
|
-
s1 = '2006-01-15T02:39:37Z'
|
214
|
-
dt1 = Gooby::DtTm.new(s1)
|
215
|
-
s2 = '2006-01-15T03:41:40Z'
|
216
|
-
dt2 = Gooby::DtTm.new(s2)
|
217
|
-
actual = dt2.hhmmss_diff(dt1)
|
218
|
-
expected = '01:02:03'
|
219
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
220
|
-
end
|
221
|
-
|
222
|
-
def test_class_DtTm_initialize
|
223
|
-
|
224
|
-
dt1 = Gooby::DtTm.new(nil)
|
225
|
-
dt2 = Gooby::DtTm.new('too short')
|
226
|
-
dt3 = Gooby::DtTm.new('2006-01-15T03:41:40Z')
|
227
|
-
|
228
|
-
assert(dt1.valid == false, "dt1 should not be valid.")
|
229
|
-
assert(dt2.valid == false, "dt2 should not be valid.")
|
230
|
-
assert(dt3.valid == true, "dt3 should not be valid.")
|
231
|
-
assert(dt1.to_i == invalid_time, "dt1 to_i should be #{invalid_time}.")
|
232
|
-
|
233
|
-
end
|
234
|
-
|
235
|
-
def test_class_DtTm_print_string
|
236
|
-
|
237
|
-
dt = Gooby::DtTm.new('2007-02-01T02:13:52Z')
|
238
|
-
actual = dt.print_string
|
239
|
-
expected = "DtTm: 2007-02-01 02:13:52 1170296032 2007-02-01T02:13:52Z"
|
240
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
241
|
-
end
|
242
|
-
|
243
|
-
def test_class_DtTm_seconds_diff
|
244
|
-
|
245
|
-
dt1 = Gooby::DtTm.new('2007-02-01T11:59:59Z')
|
246
|
-
dt2 = Gooby::DtTm.new('2007-02-01T12:00:00Z')
|
247
|
-
dt3 = Gooby::DtTm.new('2007-02-01T13:01:02')
|
248
|
-
|
249
|
-
actual = dt2.seconds_diff(dt1)
|
250
|
-
expected = 1
|
251
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
252
|
-
|
253
|
-
actual = dt3.seconds_diff(dt1)
|
254
|
-
expected = 3663
|
255
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
256
|
-
|
257
|
-
actual = dt1.seconds_diff(dt3)
|
258
|
-
expected = -3663
|
259
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
260
|
-
end
|
261
|
-
|
262
|
-
def test_class_DtTm_to_i
|
263
|
-
|
264
|
-
dt = Gooby::DtTm.new('2007-02-01T02:13:52Z')
|
265
|
-
actual = dt.to_i
|
266
|
-
expected = 1170296032
|
267
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
268
|
-
end
|
269
|
-
|
270
|
-
def test_class_DtTm_to_s
|
271
|
-
|
272
|
-
dt = Gooby::DtTm.new('2007-02-01T02:13:52Z')
|
273
|
-
actual = dt.to_s
|
274
|
-
expected = "2007-02-01T02:13:52Z"
|
275
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
276
|
-
end
|
277
|
-
|
278
|
-
def test_class_DtTm_yyyy_mm_dd
|
279
|
-
|
280
|
-
dt = Gooby::DtTm.new('2007-02-01T02:13:52Z')
|
281
|
-
actual = dt.yyyy_mm_dd
|
282
|
-
expected = "2007-02-01"
|
283
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
284
|
-
end
|
285
|
-
|
286
|
-
def test_class_DtTm_yyyy_mm_dd_hh_mm_ss
|
287
|
-
|
288
|
-
dt = Gooby::DtTm.new('2007-02-01T02:13:52Z')
|
289
|
-
actual = dt.yyyy_mm_dd_hh_mm_ss
|
290
|
-
expected = "2007-02-01 02:13:52"
|
291
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
292
|
-
end
|
293
|
-
|
294
|
-
def test_class_Duration
|
295
|
-
|
296
|
-
# This class is tested in the methods below.
|
297
|
-
end
|
298
|
-
|
299
|
-
def test_class_Duration_initialize
|
300
|
-
|
301
|
-
end
|
302
|
-
|
303
|
-
def test_class_Duration_print_string
|
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}")
|
309
|
-
end
|
310
|
-
|
311
|
-
def test_class_Duration_scrub
|
312
|
-
|
313
|
-
end
|
314
|
-
|
315
|
-
def test_class_Duration_to_s
|
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}")
|
321
|
-
end
|
322
|
-
|
323
|
-
def test_class_ForerunnerXmlParser
|
324
|
-
|
325
|
-
end
|
326
|
-
|
327
|
-
def test_class_ForerunnerXmlParser_detail_tag?
|
328
|
-
|
329
|
-
end
|
330
|
-
|
331
|
-
def test_class_ForerunnerXmlParser_dump
|
332
|
-
|
333
|
-
end
|
334
|
-
|
335
|
-
def test_class_ForerunnerXmlParser_gdump
|
336
|
-
|
337
|
-
end
|
338
|
-
|
339
|
-
def test_class_ForerunnerXmlParser_initialize
|
340
|
-
|
341
|
-
end
|
342
|
-
|
343
|
-
def test_class_ForerunnerXmlParser_is_tag?
|
344
|
-
|
345
|
-
end
|
346
|
-
|
347
|
-
def test_class_ForerunnerXmlParser_put_all_run_tkpt_csv
|
348
|
-
|
349
|
-
end
|
350
|
-
|
351
|
-
def test_class_ForerunnerXmlParser_put_run_csv
|
352
|
-
|
353
|
-
end
|
354
|
-
|
355
|
-
def test_class_ForerunnerXmlParser_tag_end
|
356
|
-
|
357
|
-
end
|
358
|
-
|
359
|
-
def test_class_ForerunnerXmlParser_tag_start
|
360
|
-
|
361
|
-
end
|
362
|
-
|
363
|
-
def test_class_ForerunnerXmlParser_text
|
364
|
-
|
365
|
-
end
|
366
|
-
|
367
|
-
def test_class_ForerunnerXmlSplitter
|
368
|
-
|
369
|
-
end
|
370
|
-
|
371
|
-
def test_class_ForerunnerXmlSplitter_end_run
|
372
|
-
|
373
|
-
end
|
374
|
-
|
375
|
-
def test_class_ForerunnerXmlSplitter_initialize
|
376
|
-
|
377
|
-
end
|
378
|
-
|
379
|
-
def test_class_ForerunnerXmlSplitter_process_file
|
380
|
-
|
381
|
-
end
|
382
|
-
|
383
|
-
def test_class_ForerunnerXmlSplitter_split
|
384
|
-
|
385
|
-
end
|
386
|
-
|
387
|
-
def test_class_ForerunnerXmlSplitter_write_files
|
388
|
-
|
389
|
-
end
|
390
|
-
|
391
|
-
def test_class_GeoData
|
392
|
-
|
393
|
-
end
|
394
|
-
|
395
|
-
def test_class_GeoData_add_poi
|
396
|
-
|
397
|
-
end
|
398
|
-
|
399
|
-
def test_class_GeoData_add_route
|
400
|
-
|
401
|
-
end
|
402
|
-
|
403
|
-
def test_class_GeoData_add_track
|
404
|
-
|
405
|
-
end
|
406
|
-
|
407
|
-
def test_class_GeoData_dump
|
408
|
-
|
409
|
-
end
|
410
|
-
|
411
|
-
def test_class_GeoData_initialize
|
412
|
-
|
413
|
-
end
|
414
|
-
|
415
|
-
def test_class_GeoData_parse_poi
|
416
|
-
|
417
|
-
end
|
418
|
-
|
419
|
-
def test_class_GeoData_parse_routes
|
420
|
-
|
421
|
-
end
|
422
|
-
|
423
|
-
def test_class_GeoData_parse_tracks
|
424
|
-
|
425
|
-
end
|
426
|
-
|
427
|
-
def test_class_GeoData_to_s
|
428
|
-
|
429
|
-
end
|
430
|
-
|
431
|
-
def test_class_GoobyCommand
|
432
|
-
|
433
|
-
end
|
434
|
-
|
435
|
-
def test_class_GoobyCommand_generate_google_map
|
436
|
-
|
437
|
-
end
|
438
|
-
|
439
|
-
def test_class_GoobyCommand_initialize
|
440
|
-
|
441
|
-
end
|
442
|
-
|
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
|
544
|
-
|
545
|
-
end
|
546
|
-
|
547
|
-
def test_class_Lap_to_s
|
548
|
-
|
549
|
-
end
|
550
|
-
|
551
|
-
def test_class_Line
|
552
|
-
|
553
|
-
end
|
554
|
-
|
555
|
-
def test_class_Line_concatinate_tokens
|
556
|
-
|
557
|
-
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
558
|
-
line = Gooby::Line.new(s)
|
559
|
-
actual = line.concatinate_tokens(2)
|
560
|
-
expected = 'Home at South Faulkner Way Stopsign'
|
561
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
562
|
-
end
|
563
|
-
|
564
|
-
def test_class_Line_initialize
|
565
|
-
|
566
|
-
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
567
|
-
line = Gooby::Line.new(s)
|
568
|
-
actual = line.tokens[6]
|
569
|
-
expected = 'Way'
|
570
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
571
|
-
end
|
572
|
-
|
573
|
-
def test_class_Line_is_comment
|
574
|
-
|
575
|
-
line = Gooby::Line.new(' # hello ')
|
576
|
-
actual = line.is_comment
|
577
|
-
expected = true
|
578
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
579
|
-
|
580
|
-
line = Gooby::Line.new('heck no')
|
581
|
-
actual = line.is_comment
|
582
|
-
expected = false
|
583
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
584
|
-
|
585
|
-
end
|
586
|
-
|
587
|
-
def test_class_Line_is_populated_non_comment
|
588
|
-
|
589
|
-
end
|
590
|
-
|
591
|
-
def test_class_Line_match
|
592
|
-
|
593
|
-
end
|
594
|
-
|
595
|
-
def test_class_Line_token
|
596
|
-
|
597
|
-
end
|
598
|
-
|
599
|
-
def test_class_Line_token_count
|
600
|
-
|
601
|
-
end
|
602
|
-
|
603
|
-
def test_class_Line_token_idx_equals
|
604
|
-
|
605
|
-
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
606
|
-
line = Gooby::Line.new(s)
|
607
|
-
|
608
|
-
actual = line.token_idx_equals(2, 'Home')
|
609
|
-
expected = true
|
610
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
611
|
-
|
612
|
-
actual = line.token_idx_equals(1, 'Home')
|
613
|
-
expected = false
|
614
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
615
|
-
|
616
|
-
actual = line.token_idx_equals(99, 'Home')
|
617
|
-
expected = false
|
618
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
619
|
-
end
|
620
|
-
|
621
|
-
def test_class_Options
|
622
|
-
|
623
|
-
end
|
624
|
-
|
625
|
-
def test_class_Options_get
|
626
|
-
|
627
|
-
options = Gooby::Options.new(nil)
|
628
|
-
actual = options.get('gmap_icon_url_base')
|
629
|
-
expected = 'http://www.joakim-systems.com/gicons/'
|
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
|
636
|
-
|
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}")
|
642
|
-
end
|
643
|
-
|
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
|
650
|
-
|
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: 26'
|
656
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
657
|
-
end
|
658
|
-
|
659
|
-
def test_class_Position
|
660
|
-
|
661
|
-
end
|
662
|
-
|
663
|
-
def test_class_Position_altitude_as_float
|
664
|
-
|
665
|
-
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
666
|
-
assert_equal(220.279, pos.altitude_as_float, "altitude is not as expected.")
|
667
|
-
end
|
668
|
-
|
669
|
-
def test_class_Position_initialize
|
670
|
-
|
671
|
-
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
672
|
-
assert_equal('35.49910', pos.latitude, "latitude is not as expected.")
|
673
|
-
assert_equal('-80.83695', pos.longitude, "longitude is not as expected.")
|
674
|
-
assert_equal('220.279', pos.altitude, "altitude is not as expected.")
|
675
|
-
end
|
676
|
-
|
677
|
-
def test_class_Position_latitude_as_float
|
678
|
-
|
679
|
-
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
680
|
-
assert_equal(35.49910, pos.latitude_as_float, "latitude is not as expected.")
|
681
|
-
end
|
682
|
-
|
683
|
-
def test_class_Position_longitude_as_float
|
684
|
-
|
685
|
-
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
686
|
-
assert_equal(-80.83695, pos.longitude_as_float, "longitude is not as expected.")
|
687
|
-
end
|
688
|
-
|
689
|
-
def test_class_Position_to_csv
|
690
|
-
|
691
|
-
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
692
|
-
actual = pos.to_csv
|
693
|
-
expected = '35.49910 | -80.83695 | 220.279'
|
694
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
695
|
-
end
|
696
|
-
|
697
|
-
def test_class_Position_to_s
|
698
|
-
|
699
|
-
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
700
|
-
actual = pos.to_s
|
701
|
-
expected = 'lat: 35.49910 lng: -80.83695 alt: 220.279 note: '
|
702
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
703
|
-
end
|
704
|
-
|
705
|
-
def test_class_Run
|
706
|
-
|
707
|
-
end
|
708
|
-
|
709
|
-
def test_class_Run_add_lap
|
710
|
-
|
711
|
-
end
|
712
|
-
|
713
|
-
def test_class_Run_add_track
|
714
|
-
|
715
|
-
end
|
716
|
-
|
717
|
-
def test_class_Run_compute_distance_and_pace
|
718
|
-
|
719
|
-
end
|
720
|
-
|
721
|
-
def test_class_Run_compute_splits
|
722
|
-
|
723
|
-
end
|
724
|
-
|
725
|
-
def test_class_Run_duration
|
726
|
-
|
727
|
-
end
|
728
|
-
|
729
|
-
def test_class_Run_end_dttm
|
730
|
-
|
731
|
-
end
|
732
|
-
|
733
|
-
def test_class_Run_end_hh_mm_ss
|
734
|
-
|
735
|
-
end
|
736
|
-
|
737
|
-
def test_class_Run_finish
|
738
|
-
|
739
|
-
end
|
740
|
-
|
741
|
-
def test_class_Run_initialize
|
742
|
-
|
743
|
-
end
|
744
|
-
|
745
|
-
def test_class_Run_lapCount
|
746
|
-
|
747
|
-
end
|
748
|
-
|
749
|
-
def test_class_Run_print_string
|
750
|
-
|
751
|
-
end
|
752
|
-
|
753
|
-
def test_class_Run_put_csv
|
754
|
-
|
755
|
-
end
|
756
|
-
|
757
|
-
def test_class_Run_put_laps
|
758
|
-
|
759
|
-
end
|
760
|
-
|
761
|
-
def test_class_Run_put_tkpt_csv
|
762
|
-
|
763
|
-
end
|
764
|
-
|
765
|
-
def test_class_Run_start_dttm
|
766
|
-
|
767
|
-
end
|
768
|
-
|
769
|
-
def test_class_Run_start_hh_mm_ss
|
770
|
-
|
771
|
-
end
|
772
|
-
|
773
|
-
def test_class_Run_start_yyyy_mm_dd
|
774
|
-
|
775
|
-
end
|
776
|
-
|
777
|
-
def test_class_Run_to_s
|
778
|
-
|
779
|
-
end
|
780
|
-
|
781
|
-
def test_class_Run_trackpoint_count
|
782
|
-
|
783
|
-
end
|
784
|
-
|
785
|
-
def test_class_SimpleXmlParser
|
786
|
-
|
787
|
-
end
|
788
|
-
|
789
|
-
def test_class_SimpleXmlParser_dump
|
790
|
-
|
791
|
-
end
|
792
|
-
|
793
|
-
def test_class_SimpleXmlParser_initialize
|
794
|
-
|
795
|
-
end
|
796
|
-
|
797
|
-
def test_class_SimpleXmlParser_tag_end
|
798
|
-
|
799
|
-
end
|
800
|
-
|
801
|
-
def test_class_SimpleXmlParser_tag_start
|
802
|
-
|
803
|
-
end
|
804
|
-
|
805
|
-
def test_class_SimpleXmlParser_text
|
806
|
-
|
807
|
-
end
|
808
|
-
|
809
|
-
def test_class_Track
|
810
|
-
|
811
|
-
end
|
812
|
-
|
813
|
-
def test_class_Track_add_trackpoint
|
814
|
-
|
815
|
-
end
|
816
|
-
|
817
|
-
def test_class_Track_dump
|
818
|
-
|
819
|
-
end
|
820
|
-
|
821
|
-
def test_class_Track_initialize
|
822
|
-
|
823
|
-
end
|
824
|
-
|
825
|
-
def test_class_Track_size
|
826
|
-
|
827
|
-
end
|
828
|
-
|
829
|
-
def test_class_Track_to_s
|
830
|
-
|
831
|
-
end
|
832
|
-
|
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
|
837
|
-
|
838
|
-
def test_class_Trackpoint_as_glatlng
|
839
|
-
|
840
|
-
end
|
841
|
-
|
842
|
-
def test_class_Trackpoint_as_info_window_html
|
843
|
-
|
844
|
-
end
|
845
|
-
|
846
|
-
def test_class_Trackpoint_compute_cumulative_pace
|
847
|
-
|
848
|
-
end
|
849
|
-
|
850
|
-
def test_class_Trackpoint_compute_distance_and_pace
|
851
|
-
|
852
|
-
end
|
853
|
-
|
854
|
-
def test_class_Trackpoint_deg2rad
|
855
|
-
|
856
|
-
end
|
857
|
-
|
858
|
-
def test_class_Trackpoint_initialize
|
859
|
-
|
860
|
-
end
|
861
|
-
|
862
|
-
def test_class_Trackpoint_is_split
|
863
|
-
|
864
|
-
end
|
865
|
-
|
866
|
-
def test_class_Trackpoint_position
|
867
|
-
|
868
|
-
end
|
869
|
-
|
870
|
-
def test_class_Trackpoint_rad2deg
|
871
|
-
|
872
|
-
end
|
873
|
-
|
874
|
-
def test_class_Trackpoint_set_split
|
875
|
-
|
876
|
-
end
|
877
|
-
|
878
|
-
def test_class_Trackpoint_split_info
|
879
|
-
|
880
|
-
end
|
881
|
-
|
882
|
-
def test_class_Trackpoint_to_csv
|
883
|
-
|
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}")
|
888
|
-
end
|
889
|
-
|
890
|
-
def test_class_Trackpoint_to_geo_s
|
891
|
-
|
892
|
-
end
|
893
|
-
|
894
|
-
def test_class_Trackpoint_to_s
|
895
|
-
|
896
|
-
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
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'
|
899
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
900
|
-
end
|
901
|
-
|
902
|
-
def test_class_TrainingCenterXmlParser
|
903
|
-
|
904
|
-
end
|
905
|
-
|
906
|
-
def test_class_TrainingCenterXmlParser_detail_tag?
|
907
|
-
|
908
|
-
end
|
909
|
-
|
910
|
-
def test_class_TrainingCenterXmlParser_dump
|
911
|
-
|
912
|
-
end
|
913
|
-
|
914
|
-
def test_class_TrainingCenterXmlParser_gdump
|
915
|
-
|
916
|
-
end
|
917
|
-
|
918
|
-
def test_class_TrainingCenterXmlParser_initialize
|
919
|
-
|
920
|
-
end
|
921
|
-
|
922
|
-
def test_class_TrainingCenterXmlParser_is_tag?
|
923
|
-
|
924
|
-
end
|
925
|
-
|
926
|
-
def test_class_TrainingCenterXmlParser_put_all_run_tkpt_csv
|
927
|
-
|
928
|
-
end
|
929
|
-
|
930
|
-
def test_class_TrainingCenterXmlParser_put_run_csv
|
931
|
-
|
932
|
-
end
|
933
|
-
|
934
|
-
def test_class_TrainingCenterXmlParser_tag_end
|
935
|
-
|
936
|
-
end
|
937
|
-
|
938
|
-
def test_class_TrainingCenterXmlParser_tag_start
|
939
|
-
|
940
|
-
end
|
941
|
-
|
942
|
-
def test_class_TrainingCenterXmlParser_text
|
943
|
-
|
944
|
-
end
|
945
|
-
|
946
|
-
def test_class_TrainingCenterXmlSplitter
|
947
|
-
|
948
|
-
end
|
949
|
-
|
950
|
-
def test_class_TrainingCenterXmlSplitter_end_run
|
951
|
-
|
952
|
-
end
|
953
|
-
|
954
|
-
def test_class_TrainingCenterXmlSplitter_initialize
|
955
|
-
|
956
|
-
end
|
957
|
-
|
958
|
-
def test_class_TrainingCenterXmlSplitter_process_file
|
959
|
-
|
960
|
-
end
|
961
|
-
|
962
|
-
def test_class_TrainingCenterXmlSplitter_split
|
963
|
-
|
964
|
-
end
|
965
|
-
|
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
|
989
|
-
end
|
990
|
-
|
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
|
998
|
-
|
999
|
-
def test_module_GoobyKernel_invalid_altitude
|
1000
|
-
|
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}")
|
1005
|
-
end
|
1006
|
-
|
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
|
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}")
|
1021
|
-
end
|
1022
|
-
|
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
|
1032
|
-
|
1033
|
-
obj = Gooby::GoobyObject.new
|
1034
|
-
end
|
1035
|
-
|
1036
|
-
def test_module_GoobyKernel_project_copyright
|
1037
|
-
|
1038
|
-
end
|
1039
|
-
|
1040
|
-
def test_module_GoobyKernel_project_date
|
1041
|
-
|
1042
|
-
obj = Gooby::GoobyObject.new
|
1043
|
-
assert_equal '2007/03/21', obj.project_date
|
1044
|
-
end
|
1045
|
-
|
1046
|
-
def test_module_GoobyKernel_project_license
|
1047
|
-
|
1048
|
-
obj = Gooby::GoobyObject.new
|
1049
|
-
assert_equal 'GNU General Public License (GPL). See http://www.gnu.org/copyleft/gpl.html', obj.project_license
|
1050
|
-
end
|
1051
|
-
|
1052
|
-
def test_module_GoobyKernel_project_version_number
|
1053
|
-
|
1054
|
-
obj = Gooby::GoobyObject.new
|
1055
|
-
assert_equal '1.0.0', obj.project_version_number
|
1056
|
-
end
|
1057
|
-
|
1058
|
-
def test_module_GoobyKernel_project_year
|
1059
|
-
|
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 '
|
1107
|
-
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
1108
|
-
end
|
1109
|
-
end
|