gooby 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +242 -0
- data/bin/example_usage.rb +38 -0
- data/bin/tests_gen.rb +16 -0
- data/data/20050305_corporate_cup_hm.csv +251 -0
- data/data/20050305_corporate_cup_hm.xml +2208 -0
- data/data/20050430_nashville_marathon.csv +1208 -0
- data/data/20050430_nashville_marathon.xml +10043 -0
- data/data/20051119_dowd_ymca_hm.csv +251 -0
- data/data/20051119_dowd_ymca_hm.xml +2210 -0
- data/data/20051124_hyatt_turkey_trot_8K.csv +321 -0
- data/data/20051124_hyatt_turkey_trot_8K.xml +2651 -0
- data/data/2007_03_03.tcx +6207 -0
- data/data/forerunner_2007.xml +259014 -0
- data/data/geo_data.txt +171 -0
- data/data/phx.csv +1280 -0
- data/data/phx.xml +10620 -0
- data/data/run_2007_01_01_16_38_27.xml +2020 -0
- data/data/run_2007_01_06_15_27_31.xml +2020 -0
- data/data/run_2007_01_10_12_25_47.xml +820 -0
- data/data/run_2007_01_10_22_44_54.csv +112 -0
- data/data/run_2007_01_10_22_44_54.xml +908 -0
- data/data/run_2007_01_11_10_48_45.xml +1292 -0
- data/data/run_2007_01_13_15_37_06.xml +1964 -0
- data/data/run_2007_01_14_15_46_02.xml +1368 -0
- data/data/run_2007_01_15_14_01_48.xml +1868 -0
- data/data/run_2007_01_20_16_22_05.xml +1702 -0
- data/data/run_2007_01_27_17_32_13.xml +3626 -0
- data/data/run_2007_01_28_19_14_52.xml +2538 -0
- data/data/run_2007_02_03_14_30_20.xml +2016 -0
- data/data/run_2007_02_04_18_02_30.xml +1476 -0
- data/data/run_2007_02_17_16_29_35.xml +1236 -0
- data/data/run_2007_02_19_14_44_33.xml +1816 -0
- data/data/run_2007_02_23_15_53_55.xml +36 -0
- data/data/run_2007_02_23_15_55_20.xml +1296 -0
- data/data/run_2007_02_24_15_01_35.csv +484 -0
- data/data/run_2007_02_24_15_01_35.xml +3884 -0
- data/data/test1.txt +4 -0
- data/img/gicons/blank.png +0 -0
- data/img/gicons/dd-end.png +0 -0
- data/img/gicons/dd-start.png +0 -0
- data/img/gicons/marker.png +0 -0
- data/img/gicons/marker0.png +0 -0
- data/img/gicons/marker00.png +0 -0
- data/img/gicons/marker01.png +0 -0
- data/img/gicons/marker02.png +0 -0
- data/img/gicons/marker03.png +0 -0
- data/img/gicons/marker04.png +0 -0
- data/img/gicons/marker05.png +0 -0
- data/img/gicons/marker06.png +0 -0
- data/img/gicons/marker07.png +0 -0
- data/img/gicons/marker08.png +0 -0
- data/img/gicons/marker09.png +0 -0
- data/img/gicons/marker1.png +0 -0
- data/img/gicons/marker10.png +0 -0
- data/img/gicons/marker11.png +0 -0
- data/img/gicons/marker12.png +0 -0
- data/img/gicons/marker13.png +0 -0
- data/img/gicons/marker14.png +0 -0
- data/img/gicons/marker15.png +0 -0
- data/img/gicons/marker16.png +0 -0
- data/img/gicons/marker17.png +0 -0
- data/img/gicons/marker18.png +0 -0
- data/img/gicons/marker19.png +0 -0
- data/img/gicons/marker2.png +0 -0
- data/img/gicons/marker20.png +0 -0
- data/img/gicons/marker21.png +0 -0
- data/img/gicons/marker22.png +0 -0
- data/img/gicons/marker23.png +0 -0
- data/img/gicons/marker24.png +0 -0
- data/img/gicons/marker25.png +0 -0
- data/img/gicons/marker26.png +0 -0
- data/img/gicons/marker27.png +0 -0
- data/img/gicons/marker28.png +0 -0
- data/img/gicons/marker29.png +0 -0
- data/img/gicons/marker3.png +0 -0
- data/img/gicons/marker30.png +0 -0
- data/img/gicons/marker31.png +0 -0
- data/img/gicons/marker32.png +0 -0
- data/img/gicons/marker33.png +0 -0
- data/img/gicons/marker34.png +0 -0
- data/img/gicons/marker35.png +0 -0
- data/img/gicons/marker36.png +0 -0
- data/img/gicons/marker37.png +0 -0
- data/img/gicons/marker38.png +0 -0
- data/img/gicons/marker39.png +0 -0
- data/img/gicons/marker4.png +0 -0
- data/img/gicons/marker40.png +0 -0
- data/img/gicons/marker41.png +0 -0
- data/img/gicons/marker42.png +0 -0
- data/img/gicons/marker43.png +0 -0
- data/img/gicons/marker44.png +0 -0
- data/img/gicons/marker45.png +0 -0
- data/img/gicons/marker46.png +0 -0
- data/img/gicons/marker47.png +0 -0
- data/img/gicons/marker48.png +0 -0
- data/img/gicons/marker49.png +0 -0
- data/img/gicons/marker5.png +0 -0
- data/img/gicons/marker50.png +0 -0
- data/img/gicons/marker51.png +0 -0
- data/img/gicons/marker52.png +0 -0
- data/img/gicons/marker53.png +0 -0
- data/img/gicons/marker54.png +0 -0
- data/img/gicons/marker55.png +0 -0
- data/img/gicons/marker56.png +0 -0
- data/img/gicons/marker57.png +0 -0
- data/img/gicons/marker58.png +0 -0
- data/img/gicons/marker59.png +0 -0
- data/img/gicons/marker6.png +0 -0
- data/img/gicons/marker60.png +0 -0
- data/img/gicons/marker61.png +0 -0
- data/img/gicons/marker62.png +0 -0
- data/img/gicons/marker63.png +0 -0
- data/img/gicons/marker64.png +0 -0
- data/img/gicons/marker65.png +0 -0
- data/img/gicons/marker66.png +0 -0
- data/img/gicons/marker67.png +0 -0
- data/img/gicons/marker68.png +0 -0
- data/img/gicons/marker69.png +0 -0
- data/img/gicons/marker7.png +0 -0
- data/img/gicons/marker70.png +0 -0
- data/img/gicons/marker71.png +0 -0
- data/img/gicons/marker72.png +0 -0
- data/img/gicons/marker73.png +0 -0
- data/img/gicons/marker74.png +0 -0
- data/img/gicons/marker75.png +0 -0
- data/img/gicons/marker76.png +0 -0
- data/img/gicons/marker77.png +0 -0
- data/img/gicons/marker78.png +0 -0
- data/img/gicons/marker79.png +0 -0
- data/img/gicons/marker8.png +0 -0
- data/img/gicons/marker80.png +0 -0
- data/img/gicons/marker81.png +0 -0
- data/img/gicons/marker82.png +0 -0
- data/img/gicons/marker83.png +0 -0
- data/img/gicons/marker84.png +0 -0
- data/img/gicons/marker85.png +0 -0
- data/img/gicons/marker86.png +0 -0
- data/img/gicons/marker87.png +0 -0
- data/img/gicons/marker88.png +0 -0
- data/img/gicons/marker89.png +0 -0
- data/img/gicons/marker9.png +0 -0
- data/img/gicons/marker90.png +0 -0
- data/img/gicons/marker91.png +0 -0
- data/img/gicons/marker92.png +0 -0
- data/img/gicons/marker93.png +0 -0
- data/img/gicons/marker94.png +0 -0
- data/img/gicons/marker95.png +0 -0
- data/img/gicons/marker96.png +0 -0
- data/img/gicons/marker97.png +0 -0
- data/img/gicons/marker98.png +0 -0
- data/img/gicons/marker99.png +0 -0
- data/img/gicons/markerA.png +0 -0
- data/img/gicons/markerB.png +0 -0
- data/img/gicons/markerC.png +0 -0
- data/img/gicons/markerD.png +0 -0
- data/img/gicons/markerE.png +0 -0
- data/img/gicons/markerF.png +0 -0
- data/img/gicons/markerG.png +0 -0
- data/img/gicons/markerH.png +0 -0
- data/img/gicons/markerI.png +0 -0
- data/img/gicons/markerJ.png +0 -0
- data/img/gicons/mm_20_red.png +0 -0
- data/img/gicons/mm_20_shadow.png +0 -0
- data/img/gicons/readme.txt +11 -0
- data/img/gicons/shadow50.png +0 -0
- data/lib/gooby/cls_counter_hash.rb +78 -0
- data/lib/gooby/cls_delim_line.rb +35 -0
- data/lib/gooby/cls_dttm.rb +79 -0
- data/lib/gooby/cls_duration.rb +79 -0
- data/lib/gooby/cls_forerunner_xml_parser.rb +178 -0
- data/lib/gooby/cls_forerunner_xml_splitter.rb +109 -0
- data/lib/gooby/cls_geo_data.rb +181 -0
- data/lib/gooby/cls_gooby_command.rb +35 -0
- data/lib/gooby/cls_gooby_object.rb +18 -0
- data/lib/gooby/cls_google_map_generator.rb +363 -0
- data/lib/gooby/cls_history.rb +33 -0
- data/lib/gooby/cls_lap.rb +22 -0
- data/lib/gooby/cls_line.rb +75 -0
- data/lib/gooby/cls_options.rb +67 -0
- data/lib/gooby/cls_position.rb +44 -0
- data/lib/gooby/cls_run.rb +194 -0
- data/lib/gooby/cls_simple_xml_parser.rb +41 -0
- data/lib/gooby/cls_test_regen.rb +182 -0
- data/lib/gooby/cls_track.rb +47 -0
- data/lib/gooby/cls_trackpoint.rb +200 -0
- data/lib/gooby/mod_introspect.rb +26 -0
- data/lib/gooby/mod_io.rb +58 -0
- data/lib/gooby/mod_project_info.rb +80 -0
- data/lib/gooby/mod_string.rb +19 -0
- data/lib/gooby/mod_test_helper.rb +15 -0
- data/lib/gooby.rb +2265 -0
- data/pkg/code_header.txt +21 -0
- data/pkg/pkg.rb +236 -0
- data/pkg/test_header.txt +19 -0
- data/samples/20041113_richmond_marathon.html +532 -0
- data/samples/20050305_corporate_cup_hm.html +448 -0
- data/samples/20050430_nashville_marathon.html +530 -0
- data/samples/gps_point_capture.html +54 -0
- data/samples/phoenix_marathon.html +542 -0
- data/samples/run_2007_01_10_22_44_54.html +201 -0
- data/samples/run_2007_02_24_15_01_35.html +298 -0
- data/tests/tc_cls_counter_hash.rb +107 -0
- data/tests/tc_cls_delim_line.rb +74 -0
- data/tests/tc_cls_dttm.rb +131 -0
- data/tests/tc_cls_duration.rb +51 -0
- data/tests/tc_cls_forerunner_xml_parser.rb +70 -0
- data/tests/tc_cls_geo_data.xxx +71 -0
- data/tests/tc_cls_gooby_object.rb +26 -0
- data/tests/tc_cls_google_map_generator.rb +109 -0
- data/tests/tc_cls_history.rb +46 -0
- data/tests/tc_cls_lap.rb +38 -0
- data/tests/tc_cls_line.rb +110 -0
- data/tests/tc_cls_options.rb +79 -0
- data/tests/tc_cls_position.rb +66 -0
- data/tests/tc_cls_run.rb +142 -0
- data/tests/tc_cls_simple_xml_parser.rb +50 -0
- data/tests/tc_cls_track.rb +70 -0
- data/tests/tc_cls_trackpoint.rb +145 -0
- data/tests/tc_mod_introspect.rb +32 -0
- data/tests/tc_mod_io.rb +53 -0
- data/tests/tc_mod_project_info.rb +79 -0
- data/tests/tc_mod_string.rb +58 -0
- data/tests/ts_gooby.rb +1237 -0
- metadata +270 -0
data/tests/tc_cls_lap.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
### Copyright 2007 by Chris Joakim.
|
2
|
+
### Gooby is available under GNU General Public License (GPL) license.
|
3
|
+
|
4
|
+
=begin rdoc
|
5
|
+
|
6
|
+
This class tests the functionality in class Gooby::Lap.
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gooby'
|
11
|
+
require 'test/unit'
|
12
|
+
|
13
|
+
class TestClassLap < Test::Unit::TestCase
|
14
|
+
|
15
|
+
include Gooby::TestHelper
|
16
|
+
|
17
|
+
@debug = false
|
18
|
+
|
19
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
20
|
+
|
21
|
+
def test_class_Lap
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_class_Lap_initialize
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_class_Lap_to_s
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
# Warning: possible obsolete test method - test_stub
|
34
|
+
|
35
|
+
def test_stub
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
### Copyright 2007 by Chris Joakim.
|
2
|
+
### Gooby is available under GNU General Public License (GPL) license.
|
3
|
+
|
4
|
+
=begin rdoc
|
5
|
+
|
6
|
+
This class tests the functionality in class Gooby::Line.
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gooby'
|
11
|
+
require 'test/unit'
|
12
|
+
|
13
|
+
class TestClassLine < Test::Unit::TestCase
|
14
|
+
|
15
|
+
include Gooby::TestHelper
|
16
|
+
|
17
|
+
@debug = false
|
18
|
+
|
19
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
20
|
+
|
21
|
+
def test_class_Line
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_class_Line_concatinate_tokens
|
26
|
+
|
27
|
+
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
28
|
+
line = Gooby::Line.new(s)
|
29
|
+
actual = line.concatinate_tokens(2)
|
30
|
+
expected = 'Home at South Faulkner Way Stopsign'
|
31
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_class_Line_initialize
|
35
|
+
|
36
|
+
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
37
|
+
line = Gooby::Line.new(s)
|
38
|
+
actual = line.tokens[6]
|
39
|
+
expected = 'Way'
|
40
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_class_Line_is_comment
|
44
|
+
|
45
|
+
line = Gooby::Line.new(' # hello ')
|
46
|
+
actual = line.is_comment
|
47
|
+
expected = true
|
48
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
49
|
+
|
50
|
+
line = Gooby::Line.new('heck no')
|
51
|
+
actual = line.is_comment
|
52
|
+
expected = false
|
53
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_class_Line_is_populated_non_comment
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_class_Line_match
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_class_Line_token
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_class_Line_token_count
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_class_Line_token_idx_equals
|
74
|
+
|
75
|
+
s = '35.4954711908794 -80.83214521408081 Home at South Faulkner Way Stopsign'
|
76
|
+
line = Gooby::Line.new(s)
|
77
|
+
|
78
|
+
actual = line.token_idx_equals(2, 'Home')
|
79
|
+
expected = true
|
80
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
81
|
+
|
82
|
+
actual = line.token_idx_equals(1, 'Home')
|
83
|
+
expected = false
|
84
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
85
|
+
|
86
|
+
actual = line.token_idx_equals(99, 'Home')
|
87
|
+
expected = false
|
88
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
89
|
+
end
|
90
|
+
|
91
|
+
# Warning: possible obsolete test method - test_class_is_populated_non_comment
|
92
|
+
|
93
|
+
def test_class_is_populated_non_comment
|
94
|
+
|
95
|
+
line = Gooby::Line.new(' # hello ')
|
96
|
+
actual = line.is_populated_non_comment
|
97
|
+
expected = false
|
98
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
99
|
+
|
100
|
+
line = Gooby::Line.new('heck no')
|
101
|
+
actual = line.is_populated_non_comment
|
102
|
+
expected = true
|
103
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
104
|
+
|
105
|
+
line = Gooby::Line.new(' ')
|
106
|
+
actual = line.is_populated_non_comment
|
107
|
+
expected = false
|
108
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
### Copyright 2007 by Chris Joakim.
|
2
|
+
### Gooby is available under GNU General Public License (GPL) license.
|
3
|
+
|
4
|
+
=begin rdoc
|
5
|
+
|
6
|
+
This class tests the functionality in class Gooby::Options.
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gooby'
|
11
|
+
require 'test/unit'
|
12
|
+
|
13
|
+
class TestClassOptions < Test::Unit::TestCase
|
14
|
+
|
15
|
+
include Gooby::TestHelper
|
16
|
+
|
17
|
+
@debug = false
|
18
|
+
|
19
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
20
|
+
|
21
|
+
def test_class_Options
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_class_Options_get
|
26
|
+
|
27
|
+
opts = Gooby::Options.new('gooby_options.yaml')
|
28
|
+
|
29
|
+
actual = opts.get('gmap_map_element_id')
|
30
|
+
expected = 'map'
|
31
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
32
|
+
|
33
|
+
actual = opts.get('gmap_width')
|
34
|
+
expected = '900px'
|
35
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
36
|
+
|
37
|
+
actual = opts.get('gmap_height')
|
38
|
+
expected = '600px'
|
39
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
40
|
+
|
41
|
+
actual = opts.get('gmap_approx_max_points')
|
42
|
+
expected = '200'.to_i
|
43
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
44
|
+
|
45
|
+
actual = opts.get('oops_not_there')
|
46
|
+
expected = ''
|
47
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
48
|
+
|
49
|
+
name = 'gmap_type_control'
|
50
|
+
actual = opts.get("#{name}")
|
51
|
+
assert(actual == true, "#{name} value is not as expected; #{actual}")
|
52
|
+
|
53
|
+
name = 'gmap_gen_comments'
|
54
|
+
actual = opts.get(name)
|
55
|
+
expected = true
|
56
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_class_Options_initialize
|
60
|
+
|
61
|
+
opts = Gooby::Options.new('gooby_options.yaml')
|
62
|
+
actual = opts.yamlFilename
|
63
|
+
expected = "gooby_options.yaml"
|
64
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_class_Options_loadFile
|
68
|
+
|
69
|
+
# This method is tested in the other test methods.
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_class_Options_to_s
|
73
|
+
|
74
|
+
opts = Gooby::Options.new('gooby_options.yaml')
|
75
|
+
actual = opts.to_s
|
76
|
+
expected = "Options: filename: gooby_options.yaml entries: 9"
|
77
|
+
# assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
### Copyright 2007 by Chris Joakim.
|
2
|
+
### Gooby is available under GNU General Public License (GPL) license.
|
3
|
+
|
4
|
+
=begin rdoc
|
5
|
+
|
6
|
+
This class tests the functionality in class Gooby::Position.
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gooby'
|
11
|
+
require 'test/unit'
|
12
|
+
|
13
|
+
class TestClassPosition < Test::Unit::TestCase
|
14
|
+
|
15
|
+
include Gooby::TestHelper
|
16
|
+
|
17
|
+
@debug = false
|
18
|
+
|
19
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
20
|
+
|
21
|
+
def test_class_Position
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_class_Position_altitude_as_float
|
26
|
+
|
27
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
28
|
+
assert_equal(220.279, pos.altitude_as_float, "altitude is not as expected.")
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_class_Position_initialize
|
32
|
+
|
33
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
34
|
+
assert_equal('35.49910', pos.latitude, "latitude is not as expected.")
|
35
|
+
assert_equal('-80.83695', pos.longitude, "longitude is not as expected.")
|
36
|
+
assert_equal('220.279', pos.altitude, "altitude is not as expected.")
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_class_Position_latitude_as_float
|
40
|
+
|
41
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
42
|
+
assert_equal(35.49910, pos.latitude_as_float, "latitude is not as expected.")
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_class_Position_longitude_as_float
|
46
|
+
|
47
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
48
|
+
assert_equal(-80.83695, pos.longitude_as_float, "longitude is not as expected.")
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_class_Position_to_csv
|
52
|
+
|
53
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
54
|
+
actual = pos.to_csv
|
55
|
+
expected = '35.49910 | -80.83695 | 220.279'
|
56
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_class_Position_to_s
|
60
|
+
|
61
|
+
pos = Gooby::Position.new('35.49910', '-80.83695', '220.279')
|
62
|
+
actual = pos.to_s
|
63
|
+
expected = 'lat: 35.49910 lng: -80.83695 alt: 220.279 note: '
|
64
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
65
|
+
end
|
66
|
+
end
|
data/tests/tc_cls_run.rb
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
### Copyright 2007 by Chris Joakim.
|
2
|
+
### Gooby is available under GNU General Public License (GPL) license.
|
3
|
+
|
4
|
+
=begin rdoc
|
5
|
+
|
6
|
+
This class tests the functionality in class Gooby::Run.
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gooby'
|
11
|
+
require 'test/unit'
|
12
|
+
|
13
|
+
class TestClassRun < Test::Unit::TestCase
|
14
|
+
|
15
|
+
include Gooby::TestHelper
|
16
|
+
|
17
|
+
@debug = false
|
18
|
+
|
19
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
20
|
+
|
21
|
+
def test_class_Run
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_class_Run_add_lap
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_class_Run_add_track
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
# Warning: possible obsolete test method - test_class_Run_compute_center_point
|
34
|
+
|
35
|
+
def test_class_Run_compute_center_point
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_class_Run_compute_distance_and_pace
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_class_Run_compute_splits
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_class_Run_duration
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_class_Run_end_dttm
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_class_Run_end_hh_mm_ss
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
# Warning: possible obsolete test method - test_class_Run_filter_trackpoints
|
60
|
+
|
61
|
+
def test_class_Run_filter_trackpoints
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_class_Run_finish
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
# Warning: possible obsolete test method - test_class_Run_generate_gmap_info
|
70
|
+
|
71
|
+
def test_class_Run_generate_gmap_info
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
# Warning: possible obsolete test method - test_class_Run_generate_gpoint_array
|
76
|
+
|
77
|
+
def test_class_Run_generate_gpoint_array
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
# Warning: possible obsolete test method - test_class_Run_generate_key_js
|
82
|
+
|
83
|
+
def test_class_Run_generate_key_js
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
# Warning: possible obsolete test method - test_class_Run_generate_overlay_points
|
88
|
+
|
89
|
+
def test_class_Run_generate_overlay_points
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_class_Run_initialize
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_class_Run_lapCount
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_class_Run_print_string
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_class_Run_put_csv
|
106
|
+
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_class_Run_put_laps
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
def test_class_Run_put_tkpt_csv
|
114
|
+
|
115
|
+
end
|
116
|
+
|
117
|
+
def test_class_Run_start_dttm
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_class_Run_start_hh_mm_ss
|
122
|
+
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_class_Run_start_yyyy_mm_dd
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_class_Run_to_s
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_class_Run_trackpoint_count
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
# Warning: possible obsolete test method - test_stub
|
138
|
+
|
139
|
+
def test_stub
|
140
|
+
|
141
|
+
end
|
142
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
### Copyright 2007 by Chris Joakim.
|
2
|
+
### Gooby is available under GNU General Public License (GPL) license.
|
3
|
+
|
4
|
+
=begin rdoc
|
5
|
+
|
6
|
+
This class tests the functionality in class Gooby::SimpleXmlParser.
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gooby'
|
11
|
+
require 'test/unit'
|
12
|
+
|
13
|
+
class TestClassSimpleXmlParser < Test::Unit::TestCase
|
14
|
+
|
15
|
+
include Gooby::TestHelper
|
16
|
+
|
17
|
+
@debug = false
|
18
|
+
|
19
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
20
|
+
|
21
|
+
def test_class_SimpleXmlParser
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_class_SimpleXmlParser_dump
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_class_SimpleXmlParser_initialize
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_class_SimpleXmlParser_tag_end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_class_SimpleXmlParser_tag_start
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_class_SimpleXmlParser_text
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
# Warning: possible obsolete test method - test_stub
|
46
|
+
|
47
|
+
def test_stub
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
### Copyright 2007 by Chris Joakim.
|
2
|
+
### Gooby is available under GNU General Public License (GPL) license.
|
3
|
+
|
4
|
+
=begin rdoc
|
5
|
+
|
6
|
+
This class tests the functionality in class Gooby::Track.
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gooby'
|
11
|
+
require 'test/unit'
|
12
|
+
|
13
|
+
class TestClassTrack < Test::Unit::TestCase
|
14
|
+
|
15
|
+
include Gooby::TestHelper
|
16
|
+
|
17
|
+
@debug = false
|
18
|
+
|
19
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
20
|
+
|
21
|
+
def test_class_Track
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_class_Track_add_trackpoint
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_class_Track_dump
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
# Warning: possible obsolete test method - test_class_Track_firstTkpt
|
34
|
+
|
35
|
+
def test_class_Track_firstTkpt
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_class_Track_first_tkpt
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_class_Track_initialize
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
# Warning: possible obsolete test method - test_class_Track_lastTkpt
|
48
|
+
|
49
|
+
def test_class_Track_lastTkpt
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_class_Track_last_tkpt
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_class_Track_size
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_class_Track_to_s
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
# Warning: possible obsolete test method - test_stub
|
66
|
+
|
67
|
+
def test_stub
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
### Copyright 2007 by Chris Joakim.
|
2
|
+
### Gooby is available under GNU General Public License (GPL) license.
|
3
|
+
|
4
|
+
=begin rdoc
|
5
|
+
|
6
|
+
This class tests the functionality in class Gooby::Trackpoint.
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gooby'
|
11
|
+
require 'test/unit'
|
12
|
+
|
13
|
+
class TestClassTrackpoint < Test::Unit::TestCase
|
14
|
+
|
15
|
+
include Gooby::TestHelper
|
16
|
+
|
17
|
+
@debug = false
|
18
|
+
|
19
|
+
### Start of tests. Keep this line - see class TestGenerator.
|
20
|
+
|
21
|
+
def test_class_Trackpoint
|
22
|
+
|
23
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
24
|
+
end
|
25
|
+
|
26
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_altitude_as_float
|
27
|
+
|
28
|
+
def test_class_Trackpoint_altitude_as_float
|
29
|
+
|
30
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
31
|
+
actual = tkpt.altitude_as_float
|
32
|
+
expected = 220.279
|
33
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_class_Trackpoint_as_glatlng
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_class_Trackpoint_as_info_window_html
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_as_overlay_finish_point
|
45
|
+
|
46
|
+
def test_class_Trackpoint_as_overlay_finish_point
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_as_overlay_point
|
51
|
+
|
52
|
+
def test_class_Trackpoint_as_overlay_point
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_as_overlay_start_point
|
57
|
+
|
58
|
+
def test_class_Trackpoint_as_overlay_start_point
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_class_Trackpoint_compute_cumulative_pace
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_class_Trackpoint_compute_distance_and_pace
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_class_Trackpoint_deg2rad
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_class_Trackpoint_initialize
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_class_Trackpoint_is_first
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_class_Trackpoint_is_last
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_class_Trackpoint_is_split
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_latitude_as_float
|
91
|
+
|
92
|
+
def test_class_Trackpoint_latitude_as_float
|
93
|
+
|
94
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
95
|
+
actual = tkpt.latitude_as_float
|
96
|
+
expected = 35.49910
|
97
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
98
|
+
end
|
99
|
+
|
100
|
+
# Warning: possible obsolete test method - test_class_Trackpoint_longitude_as_float
|
101
|
+
|
102
|
+
def test_class_Trackpoint_longitude_as_float
|
103
|
+
|
104
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
105
|
+
actual = tkpt.longitude_as_float
|
106
|
+
expected = -80.83695
|
107
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_class_Trackpoint_position
|
111
|
+
|
112
|
+
end
|
113
|
+
|
114
|
+
def test_class_Trackpoint_rad2deg
|
115
|
+
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_class_Trackpoint_set_split
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_class_Trackpoint_split_info
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
def test_class_Trackpoint_to_csv
|
127
|
+
|
128
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
129
|
+
actual = tkpt.to_csv
|
130
|
+
expected = '0 | 2007-02-01T02:13:52Z | 1 | 35.49910 | -80.83695 | 220.279 | 0.0 '
|
131
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_class_Trackpoint_to_geo_s
|
135
|
+
|
136
|
+
end
|
137
|
+
|
138
|
+
def test_class_Trackpoint_to_s
|
139
|
+
|
140
|
+
tkpt = Gooby::Trackpoint.new(1, '35.49910', '-80.83695', '220.279', '2007-02-01T02:13:52Z')
|
141
|
+
actual = tkpt.to_s
|
142
|
+
expected = 'Tkpt: 1 lat: 35.49910 lng: -80.83695 alt: 220.279 note: date: 2007-02-01T02:13:52Z cdist: 0.0'
|
143
|
+
assert_equal(expected, actual, "value is not as expected; #{actual} vs #{expected}")
|
144
|
+
end
|
145
|
+
end
|