equationoftime 4.1.7 → 4.1.8
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.
- checksums.yaml +8 -8
- data/.travis.yml +7 -0
- data/Gemfile +0 -1
- data/Manifest.txt +1 -0
- data/Rakefile +37 -9
- data/equationoftime.gemspec +12 -9
- data/examples/Equation_of_Time.png +0 -0
- data/examples/cal2jd.rb +10 -0
- data/examples/celes_formatters.rb +23 -0
- data/examples/eot_from_noon.rb +14 -0
- data/examples/eot_methods_list.rb +7 -0
- data/examples/my_lst.rb +11 -0
- data/examples/radians2degformated.rb +6 -0
- data/examples/t_sofa.rb +8229 -0
- data/examples/test_eot_c.rb +24 -0
- data/examples/use_addr.rb +20 -0
- data/examples/use_ajd.rb +40 -0
- data/ext/eot/ceot.c +3 -4
- data/ext/eot/eot.c +87 -43
- data/lib/eot/all.rb +11 -0
- data/lib/eot/angle_displays.rb +27 -13
- data/lib/eot/angles.rb +65 -7
- data/lib/eot/constants.rb +40 -3
- data/lib/eot/eot.so +0 -0
- data/lib/eot/times.rb +9 -1
- data/lib/eot/version.rb +1 -1
- data/test/eot/aliased_angles_spec.rb +293 -0
- data/test/eot/aliased_displays_spec.rb +127 -0
- data/test/eot/aliased_utilities_spec.rb +34 -0
- data/test/eot/angles_spec.rb +264 -0
- data/test/eot/constants_spec.rb +18 -0
- data/test/eot/displays_spec.rb +114 -0
- data/test/eot/geo_spec.rb +40 -0
- data/test/eot/init_spec.rb +45 -0
- data/test/eot/times_spec.rb +199 -0
- data/wiki.md +4 -3
- metadata +64 -29
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# aliased_utilities_spec.rb
|
|
2
|
+
gem 'minitest'
|
|
3
|
+
require 'minitest/autorun'
|
|
4
|
+
lib = File.expand_path('../../../lib', __FILE__)
|
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
6
|
+
require 'eot'
|
|
7
|
+
|
|
8
|
+
aliased_utilities = Eot.new
|
|
9
|
+
|
|
10
|
+
describe 'tests ajd of 2456885.0' do
|
|
11
|
+
|
|
12
|
+
before(:each) do
|
|
13
|
+
aliased_utilities.ajd = 2_456_885.0
|
|
14
|
+
ajd = aliased_utilities.ajd
|
|
15
|
+
aliased_utilities.ma_ta_set
|
|
16
|
+
# check date for this ajd when needed.
|
|
17
|
+
aliased_utilities.date = aliased_utilities.ajd_to_datetime(ajd)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'expected 2456885.0 for aliased_utilities.ajd'do
|
|
21
|
+
assert_equal 2_456_885.0, aliased_utilities.ajd
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'expected 3.8508003966038915 for aliased_utilities.ma'do
|
|
25
|
+
assert_equal 3.8508003966038915, aliased_utilities.ma
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'expected 0.0 returned by aliased_utilities.truncate() ' do
|
|
29
|
+
assert_equal 0.0, aliased_utilities.truncate
|
|
30
|
+
assert_equal 0.0, aliased_utilities.truncate(nil)
|
|
31
|
+
assert_equal 0.0, aliased_utilities.truncate(0)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# angles_spec.rb
|
|
2
|
+
gem 'minitest'
|
|
3
|
+
require 'minitest/autorun'
|
|
4
|
+
lib = File.expand_path('../../../lib', __FILE__)
|
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
6
|
+
require 'eot'
|
|
7
|
+
|
|
8
|
+
angles = Eot.new
|
|
9
|
+
|
|
10
|
+
describe 'Tests ajd of 2456885.0 ' do
|
|
11
|
+
|
|
12
|
+
before(:each) do
|
|
13
|
+
angles.ajd = 2_456_885.0
|
|
14
|
+
ajd = angles.ajd
|
|
15
|
+
angles.ma_ta_set
|
|
16
|
+
# check date for this ajd when needed.
|
|
17
|
+
angles.date = angles.ajd_to_datetime(ajd)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'expected 2456885.0 for angles.ajd'do
|
|
21
|
+
assert_equal(2_456_885.0, angles.ajd)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'expected "2014-08-15T12:00:00+00:00" for angles.date'.to_s do
|
|
25
|
+
assert_equal('2014-08-15T12:00:00+00:00', angles.date.to_s)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'expected 3.8508003966038915 for angles.ma'do
|
|
29
|
+
assert_equal(3.8508003966038915, angles.ma)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'expected 2.4887103398436143 from angles.al_sun()? ' do
|
|
33
|
+
assert_equal(2.4887103398436143, angles.al_sun)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it 'expected -0.021413249720702462 from angles.centre()? ' do
|
|
37
|
+
assert_equal(-0.021413249720702462, angles.center)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'expected -0.7943361570447028 from angles.cosine_al_sun()? ' do
|
|
41
|
+
assert_equal(-0.7943361570447028, angles.cosine_al_sun)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it 'expected -0.7943772759574919 from angles.cosine_tl_sun()? ' do
|
|
45
|
+
assert_equal(-0.7943772759574919, angles.cosine_tl_sun)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it 'expected 0.9175115346811911 from angles.cosine_to_earth()? ' do
|
|
49
|
+
assert_equal(0.9175115346811911, angles.cosine_to_earth)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'expected 0.24401410218543554 from angles.dec_sun()? ' do
|
|
53
|
+
assert_equal(0.24401410218543554, angles.dec_sun)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
it 'expected -4.069792718159396e-05 from angles.delta_epsilon()? ' do
|
|
57
|
+
assert_equal(-4.069792718159396e-05, angles.delta_epsilon)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
it 'expected -0.04103082558803539 from angles.delta_oblique()? ' do
|
|
61
|
+
assert_equal(-0.04103082558803539, angles.delta_oblique)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
it 'expected 0.021413249720702462 from angles.delta_orbit()? ' do
|
|
65
|
+
assert_equal(0.021413249720702462, angles.delta_orbit)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
it 'expected 3.75123821843003e-05 from angles.delta_psi()? ' do
|
|
69
|
+
assert_equal(3.75123821843003e-05, angles.delta_psi)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
it 'expected 0.016702468499021204 from \
|
|
73
|
+
angles.eccentricity_earth()? ' do
|
|
74
|
+
assert_equal(0.016702468499021204, angles.eccentricity_earth)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
it 'expected 3.4412912434333975e-05 from angles.eq_of_equinox()? ' do
|
|
78
|
+
assert_equal(3.4412912434333975e-05, angles.eq_of_equinox)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
it 'expected -0.01961757586733293 from angles.eot()? ' do
|
|
82
|
+
assert_equal(-0.01961757586733293, angles.eot)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it 'expected 2.5101912804141424 from angles.gml_sun()? ' do
|
|
86
|
+
assert_equal(2.5101912804141424, angles.gml_sun)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
it 'expected 1.5857841877939605 from angles.ha_sun(1)? ' do
|
|
90
|
+
assert_equal(1.5857841877939605, angles.ha_sun(1))
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
it 'expected 3.8508003966038915 from angles.ma_sun()? ' do
|
|
94
|
+
assert_equal(3.8508003966038915, angles.ma_sun)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
it 'expected 2.510089864980358 from angles.ml_aries()? ' do
|
|
98
|
+
assert_equal(2.510089864980358, angles.ml_aries)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it 'expected 0.40905940254265843 from angles.mo_earth()? ' do
|
|
102
|
+
assert_equal(0.40905940254265843, angles.mo_earth)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
it 'expected -2.7528817371494685 from angles.omega()? ' do
|
|
106
|
+
assert_equal(-2.7528817371494685, angles.omega)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
it 'expected 2.5297411654316497 from angles.ra_sun()? ' do
|
|
110
|
+
assert_equal(2.5297411654316497, angles.ra_sun)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
it 'expected 0.6074784519729512 from angles.sine_al_sun()? ' do
|
|
114
|
+
assert_equal(0.6074784519729512, angles.sine_al_sun)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
it 'expected 0.6074246812917259 from angles.sine_tl_sun()? ' do
|
|
118
|
+
assert_equal(0.6074246812917259, angles.sine_tl_sun)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
it 'expected 3.8293871468831893 from angles.ta_sun()? ' do
|
|
122
|
+
assert_equal(3.8293871468831893, angles.ta_sun)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
it 'expected 2.5101242776531474 from angles.tl_aries()? ' do
|
|
126
|
+
assert_equal(2.5101242776531474, angles.tl_aries)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
it 'expected 2.48877803069344 from angles.tl_sun()? ' do
|
|
130
|
+
assert_equal(2.48877803069344, angles.tl_sun)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
it 'expected 0.40901870461547685 from angles.to_earth()? ' do
|
|
134
|
+
assert_equal(0.40901870461547685, angles.to_earth)
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
describe 'Tests ajd of 2455055.5 ' do
|
|
139
|
+
|
|
140
|
+
before(:each) do
|
|
141
|
+
angles.ajd = 2_455_055.0
|
|
142
|
+
ajd = angles.ajd
|
|
143
|
+
angles.ma_ta_set
|
|
144
|
+
# check date for this ajd when needed.
|
|
145
|
+
angles.date = angles.ajd_to_datetime(ajd)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
it 'expected 2455055.0, from angles.' do
|
|
149
|
+
assert_equal(2_455_055.0, angles.ajd)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
it 'expected "2009-08-11T12:00:00+00:00", from angles.date.to_s' do
|
|
153
|
+
assert_equal('2009-08-11T12:00:00+00:00', angles.date.to_s)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
it 'expected 3.7871218188949207, from angles.' do
|
|
157
|
+
assert_equal(3.7871218188949207, angles.ma)
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
it 'expected 2.4252140645725033 from angles.al_sun()? ' do
|
|
161
|
+
assert_equal(2.4252140645725033, angles.al_sun)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
it 'expected -0.019768413456709915 from angles.center()? ' do
|
|
165
|
+
assert_equal(-0.019768413456709915, angles.center)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
it 'expected -0.7541886969975007 from angles.cosine_al_sun()? ' do
|
|
169
|
+
assert_equal(-0.7541886969975007, angles.cosine_al_sun)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
it 'expected -0.7542060769936684 from angles.cosine_tl_sun()? ' do
|
|
173
|
+
assert_equal(-0.7542060769936684, angles.cosine_tl_sun)
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
it 'expected 0.9174818088112336 from angles.cosine_to_earth()? ' do
|
|
177
|
+
assert_equal(0.9174818088112336, angles.cosine_to_earth)
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
it 'expected 0.2642691272294404 from angles.dec_sun()? ' do
|
|
181
|
+
assert_equal(0.2642691272294404, angles.dec_sun)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
it 'expected 2.2661506700250296e-05 from angles.delta_epsilon()? ' do
|
|
185
|
+
assert_equal(2.2661506700250296e-05, angles.delta_epsilon)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
it 'expected -0.04234904897476355 from angles.delta_oblique()? ' do
|
|
189
|
+
assert_equal(-0.04234904897476355, angles.delta_oblique)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
it 'expected 0.019768413456709915 from angles.delta_orbit()? ' do
|
|
193
|
+
assert_equal(0.019768413456709915, angles.delta_orbit)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
it 'expected 7.639341522992976e-05 from angles.delta_psi()? ' do
|
|
197
|
+
assert_equal(7.639341522992976e-05, angles.delta_psi)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
it 'expected 0.016704576164208475 from \
|
|
201
|
+
angles.eccentricity_earth()? ' do
|
|
202
|
+
assert_equal(0.016704576164208475, angles.eccentricity_earth)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
it 'expected 7.007879585074761e-05 from angles.eq_of_equinox()? ' do
|
|
206
|
+
assert_equal(7.007879585074761e-05, angles.eq_of_equinox)
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
it 'expected -0.022580635518053633 from angles.eot()? ' do
|
|
210
|
+
assert_equal(-0.022580635518053633, angles.eot)
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
it 'expected 2.445008945789877 from angles.gml_sun()? ' do
|
|
214
|
+
assert_equal(2.445008945789877, angles.gml_sun)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
it 'expected 1.585863261753274 from angles.ha_sun(1)? ' do
|
|
218
|
+
assert_equal(1.585863261753274, angles.ha_sun(1))
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
it 'expected 3.7871218188949207 from angles.ma_sun()? ' do
|
|
222
|
+
assert_equal(3.7871218188949207, angles.ma_sun)
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
it 'expected 2.444907382260759 from angles.ml_aries()? ' do
|
|
226
|
+
assert_equal(2.444907382260759, angles.ml_aries)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
it 'expected 0.4090707793981491 from angles.mo_earth()? ' do
|
|
230
|
+
assert_equal(0.4090707793981491, angles.mo_earth)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
it 'expected -1.0615640635268548 from angles.omega()? ' do
|
|
234
|
+
assert_equal(-1.0615640635268548, angles.omega)
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
it 'expected 2.467563113547267 from angles.ra_sun()? ' do
|
|
238
|
+
assert_equal(2.467563113547267, angles.ra_sun)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
it 'expected 0.6566577566139093 from angles.sine_al_sun()? ' do
|
|
242
|
+
assert_equal(0.6566577566139093, angles.sine_al_sun)
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
it 'expected 0.6566377946979757 from angles.sine_tl_sun()? ' do
|
|
246
|
+
assert_equal(0.6566377946979757, angles.sine_tl_sun)
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
it 'expected 3.767353405438211 from angles.ta_sun()? ' do
|
|
250
|
+
assert_equal(3.767353405438211, angles.ta_sun)
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
it 'expected 2.4449774607872907 from angles.tl_aries()? ' do
|
|
254
|
+
assert_equal(2.4449774607872907, angles.tl_aries)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
it 'expected 2.4252405323331674 from angles.tl_sun()? ' do
|
|
258
|
+
assert_equal(2.4252405323331674, angles.tl_sun)
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
it 'expected 0.4090934409048494 from angles.to_earth()? ' do
|
|
262
|
+
assert_equal(0.4090934409048494, angles.to_earth)
|
|
263
|
+
end
|
|
264
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# constants_spec.rb
|
|
2
|
+
gem 'minitest'
|
|
3
|
+
require 'minitest/autorun'
|
|
4
|
+
lib = File.expand_path('../../../lib', __FILE__)
|
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
6
|
+
require 'eot'
|
|
7
|
+
|
|
8
|
+
describe 'Equation of Time constants.' do
|
|
9
|
+
|
|
10
|
+
it "01 require 'eot' should find all constants." do
|
|
11
|
+
assert_equal 24.0, Eot::DAY_HOURS
|
|
12
|
+
assert_equal 1440.0, Eot::DAY_MINUTES
|
|
13
|
+
assert_equal 86_400.0, Eot::DAY_SECONDS
|
|
14
|
+
assert_equal 86_400.0 * 1.0e+6, Eot::DAY_USECS
|
|
15
|
+
assert_equal 57.29577951308232, Eot::R2D
|
|
16
|
+
assert_equal 0.017453292519943295, Eot::D2R
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# displays_spec.rb
|
|
2
|
+
|
|
3
|
+
gem 'minitest'
|
|
4
|
+
require 'minitest/autorun'
|
|
5
|
+
lib = File.expand_path('../../../lib', __FILE__)
|
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
7
|
+
require 'eot'
|
|
8
|
+
|
|
9
|
+
displays = Eot.new
|
|
10
|
+
|
|
11
|
+
describe 'Eot displays using ajd of 2456885.0' do
|
|
12
|
+
|
|
13
|
+
before(:each) do
|
|
14
|
+
displays.ajd = 2_456_885.0
|
|
15
|
+
ajd = displays.ajd
|
|
16
|
+
displays.ma_ta_set
|
|
17
|
+
# check date for this ajd when needed.
|
|
18
|
+
displays.date = displays.ajd_to_datetime(ajd)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'expected 2456885.0 for displays.ajd'do
|
|
22
|
+
assert_equal 2_456_885.0, displays.ajd
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'expected "2014-08-15T12:00:00+00:00", from displays.date.to_s' do
|
|
26
|
+
assert_equal '2014-08-15T12:00:00+00:00', displays.date.to_s
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'expected 3.8508003966038915, from displays.' do
|
|
30
|
+
assert_equal 3.8508003966038915, displays.ma
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it 'expected "+000:00:00.000" from displays.degrees_to_s() ' do
|
|
34
|
+
assert_equal '+000:00:00.000', displays.degrees_to_s
|
|
35
|
+
assert_equal '+000:00:00.000', displays.degrees_to_s(nil)
|
|
36
|
+
assert_equal '+000:00:00.000', displays.degrees_to_s(0)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it 'expected "+142:35:33.356" from displays.string_al_sun() ' do
|
|
40
|
+
assert_equal '+142:35:33.356', displays.string_al_sun
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
it 'expected "12:00:00" from displays.string_day_fraction_to_time() ' do
|
|
44
|
+
assert_equal '12:00:00', displays.string_day_fraction_to_time
|
|
45
|
+
assert_equal '12:00:00', displays.string_day_fraction_to_time(nil)
|
|
46
|
+
assert_equal '12:00:00', displays.string_day_fraction_to_time(0)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it 'expected "+013:58:51.522" from displays.string_dec_sun() ' do
|
|
50
|
+
assert_equal '+013:58:51.522', displays.string_dec_sun
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
it 'expected "-04m, 29.2s" from displays.string_eot() ' do
|
|
54
|
+
assert_equal '-04m, 29.2s', displays.string_eot
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it 'expected "2000-01-01" from displays.string_jd_to_date() ' do
|
|
58
|
+
assert_equal '2000-01-01', displays.string_jd_to_date
|
|
59
|
+
assert_equal '2000-01-01', displays.string_jd_to_date(nil)
|
|
60
|
+
assert_equal '2000-01-01', displays.string_jd_to_date(0)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
it 'expected "2014-08-15" from \
|
|
64
|
+
displays.jd_to_date_string(displays.ajd)? ' do
|
|
65
|
+
assert_equal '2014-08-15', displays.jd_to_date_string(displays.ajd)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
it 'expected "+220:38:04.598" from displays.string_ma_sun() ' do
|
|
69
|
+
assert_equal '+220:38:04.598', displays.string_ma_sun
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
it 'expected "+144:56:36.571" from displays.string_ra_sun() ' do
|
|
73
|
+
assert_equal '+144:56:36.571', displays.string_ra_sun
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it 'expected "+219:24:27.798" from displays.string_ta_sun() ' do
|
|
77
|
+
assert_equal '+219:24:27.798', displays.string_ta_sun
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it 'expected "12:00:00.000" from displays.string_time() ' do
|
|
81
|
+
assert_equal '12:00:00.000', displays.string_time
|
|
82
|
+
assert_equal '12:00:00.000', displays.string_time(nil)
|
|
83
|
+
assert_equal '12:00:00.000', displays.string_time(0)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
it 'expected "12:00:00.000" from \
|
|
87
|
+
displays.display_time_string(Eot_adisplays.date)? ' do
|
|
88
|
+
assert_equal '12:00:00.000', \
|
|
89
|
+
displays.display_time_string(displays.date)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
it 'expected "+142:35:47.318" from \
|
|
93
|
+
displays.string_tl_sun() ' do
|
|
94
|
+
assert_equal '+142:35:47.318', displays.string_tl_sun
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
it 'expected "+023:26:06.164" from displays.string_to_earth() ' do
|
|
98
|
+
assert_equal '+023:26:06.164', displays.string_to_earth
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
describe 'Eot displays explicit values' do
|
|
104
|
+
|
|
105
|
+
it 'expected "16:40:40.800" from displays.string_time(16.6780) ' do
|
|
106
|
+
assert_equal '16:40:40.800', displays.string_time(16.6780)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
it 'expected "17:59:16.800" from displays.string_time(17988) ' do
|
|
110
|
+
displays.date = Date.today.to_s
|
|
111
|
+
assert_equal '17:59:16.800', displays.string_time(17.988)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# geo_spec.rb/
|
|
2
|
+
gem 'minitest'
|
|
3
|
+
require 'minitest/autorun'
|
|
4
|
+
|
|
5
|
+
lib = File.expand_path('../../../lib', __FILE__)
|
|
6
|
+
$LOAD_PATH.unshift(lib) unless$LOAD_PATH.include?(lib)
|
|
7
|
+
require 'eot'
|
|
8
|
+
|
|
9
|
+
geo = GeoLatLng.new
|
|
10
|
+
|
|
11
|
+
describe 'Geo defaults' do
|
|
12
|
+
|
|
13
|
+
INTERNATIONAL = geo.default_int
|
|
14
|
+
it "expected #{INTERNATIONAL}" do
|
|
15
|
+
assert_equal INTERNATIONAL, geo.addr
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
BASE = 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address='
|
|
19
|
+
it "expected #{BASE}" do
|
|
20
|
+
assert_equal BASE, geo.base_json
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it 'expected #{INTERNATIONAL 'do
|
|
24
|
+
assert_equal INTERNATIONAL, geo.default_int
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
DEFAULT_US = '3333 Coyote Hill Road, Palo Alto, CA, 94304, USA'
|
|
28
|
+
it 'expected DEFAULT_US 'do
|
|
29
|
+
assert_equal DEFAULT_US, geo.default_us
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'expected 0.0'do
|
|
33
|
+
assert_equal 0.0, geo.lat
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it 'expected 0.0'do
|
|
37
|
+
assert_equal 0.0, geo.lng
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|