eagletree-log 0.0.14 → 0.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.
- checksums.yaml +4 -4
- data/lib/eagletree/log/file.rb +3 -5
- data/lib/eagletree/log/version.rb +1 -1
- data/spec/file_spec.rb +41 -13
- data/spec/session_spec.rb +90 -86
- data/spec/spec_helper.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d74a8ca1e2c22ea2bca99fbba550e82cc3cc29a4
|
4
|
+
data.tar.gz: bbd72ab047a601ae00f532312b4be37f73d01a6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c69c4a594cf33c68c59004f28bce7b64d1f4a4b0fc0c726446064a1544eaf3668622842442995899c4a2621de48f2f5275ad6b7c6c04072803944a2a36351aec
|
7
|
+
data.tar.gz: bf4a4bfddbff477a7c5e2198e4d5c021feeb961ffd105c57445b39647b327764ac6eaebcbf6c71cb8c3229df9661879acda8d90c97ec7305b6fdd9db92e5dad8
|
data/lib/eagletree/log/file.rb
CHANGED
@@ -19,14 +19,12 @@ module EagleTree
|
|
19
19
|
# @return [FixNum] Version of the data recorder software
|
20
20
|
attr_reader :version
|
21
21
|
|
22
|
-
# Determines if the file at the given URI is a EagleTree log file.
|
23
|
-
# to read the file, simply using #new should be preferred in favor of this, catching any
|
24
|
-
# errors that may be raised.
|
22
|
+
# Determines if the file at the given URI is a EagleTree log file.
|
25
23
|
#
|
26
24
|
# @param uri URI to file to read
|
27
|
-
# @return [
|
25
|
+
# @return [EagleTree::Log::File] loaded file if the file is an Eagle Tree log file, nil otherwise
|
28
26
|
def self.eagle_tree? uri
|
29
|
-
|
27
|
+
File.new(uri) rescue nil
|
30
28
|
end
|
31
29
|
|
32
30
|
def initialize uri
|
data/spec/file_spec.rb
CHANGED
@@ -6,7 +6,9 @@ describe EagleTree::Log::File do
|
|
6
6
|
|
7
7
|
context 'data file empty.fdr' do
|
8
8
|
|
9
|
-
|
9
|
+
before(:all) { @file = empty_fdr }
|
10
|
+
|
11
|
+
subject { @file }
|
10
12
|
|
11
13
|
it { should have(0).sessions }
|
12
14
|
|
@@ -20,7 +22,9 @@ describe EagleTree::Log::File do
|
|
20
22
|
|
21
23
|
context 'data file funjet-gps.fdr' do
|
22
24
|
|
23
|
-
|
25
|
+
before(:all) { @file = funjet_fdr }
|
26
|
+
|
27
|
+
subject { @file }
|
24
28
|
|
25
29
|
it { should have(1).sessions }
|
26
30
|
|
@@ -36,7 +40,9 @@ describe EagleTree::Log::File do
|
|
36
40
|
|
37
41
|
context 'data file multi-session-1.fdr' do
|
38
42
|
|
39
|
-
|
43
|
+
before(:all) { @file = multi_1_fdr }
|
44
|
+
|
45
|
+
subject { @file }
|
40
46
|
|
41
47
|
it { should have(3).sessions }
|
42
48
|
|
@@ -52,7 +58,9 @@ describe EagleTree::Log::File do
|
|
52
58
|
|
53
59
|
context 'data file multi-session-2.fdr' do
|
54
60
|
|
55
|
-
|
61
|
+
before(:all) { @file = multi_2_fdr }
|
62
|
+
|
63
|
+
subject { @file }
|
56
64
|
|
57
65
|
it { should have(3).sessions }
|
58
66
|
|
@@ -66,7 +74,9 @@ describe EagleTree::Log::File do
|
|
66
74
|
|
67
75
|
context 'data file t600-1.fdr' do
|
68
76
|
|
69
|
-
|
77
|
+
before(:all) { @file = t600_1_fdr }
|
78
|
+
|
79
|
+
subject { @file }
|
70
80
|
|
71
81
|
it { should have(1).sessions }
|
72
82
|
|
@@ -80,7 +90,9 @@ describe EagleTree::Log::File do
|
|
80
90
|
|
81
91
|
context 'data file t600-2.fdr' do
|
82
92
|
|
83
|
-
|
93
|
+
before(:all) { @file = t600_2_fdr }
|
94
|
+
|
95
|
+
subject { @file }
|
84
96
|
|
85
97
|
it { should have(1).sessions }
|
86
98
|
|
@@ -110,7 +122,7 @@ describe EagleTree::Log::File do
|
|
110
122
|
files.should have(17).files
|
111
123
|
|
112
124
|
files.each do |f|
|
113
|
-
EagleTree::Log::File.eagle_tree?(f).
|
125
|
+
expect(EagleTree::Log::File.eagle_tree?(f)).to be_false
|
114
126
|
end
|
115
127
|
end
|
116
128
|
|
@@ -119,17 +131,27 @@ describe EagleTree::Log::File do
|
|
119
131
|
files.should have(9).files
|
120
132
|
|
121
133
|
files.each do |f|
|
122
|
-
EagleTree::Log::File.eagle_tree?(f).
|
134
|
+
expect(EagleTree::Log::File.eagle_tree?(f)).to be_true
|
123
135
|
end
|
124
136
|
end
|
125
137
|
|
138
|
+
it 'should return a file object' do
|
139
|
+
expect(EagleTree::Log::File.eagle_tree?(data_files[0])).to be_a(EagleTree::Log::File)
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'should return nil when invalid' do
|
143
|
+
expect(EagleTree::Log::File.eagle_tree?(invalid_data_files[0])).to be_nil
|
144
|
+
end
|
145
|
+
|
126
146
|
end
|
127
147
|
|
128
148
|
describe '#to_kml' do
|
129
149
|
|
130
150
|
context 'with file with GPS data' do
|
131
151
|
|
132
|
-
|
152
|
+
before(:all) { @file = funjet_fdr }
|
153
|
+
|
154
|
+
subject { @file }
|
133
155
|
|
134
156
|
its(:to_kml?) { should be_true }
|
135
157
|
|
@@ -139,7 +161,9 @@ describe EagleTree::Log::File do
|
|
139
161
|
|
140
162
|
context 'with file without GPS data' do
|
141
163
|
|
142
|
-
|
164
|
+
before(:all) { @file = multi_1_fdr }
|
165
|
+
|
166
|
+
subject { @file }
|
143
167
|
|
144
168
|
its(:to_kml?) { should be_false }
|
145
169
|
|
@@ -155,20 +179,24 @@ describe EagleTree::Log::File do
|
|
155
179
|
|
156
180
|
context 'with file with GPS data' do
|
157
181
|
|
158
|
-
|
182
|
+
before(:all) { @file = funjet_fdr }
|
183
|
+
|
184
|
+
subject { @file }
|
159
185
|
|
160
186
|
its(:to_kml_file) { should be_a(KMLFile) }
|
161
187
|
|
162
188
|
it 'should take options for file and placemark' do
|
163
189
|
kml = subject.to_kml_file({ :name => 'File Name' })
|
164
|
-
kml.objects[0].name.
|
190
|
+
expect(kml.objects[0].name).to eql('File Name')
|
165
191
|
end
|
166
192
|
|
167
193
|
end
|
168
194
|
|
169
195
|
context 'with file without GPS data' do
|
170
196
|
|
171
|
-
|
197
|
+
before(:all) { @file = multi_1_fdr }
|
198
|
+
|
199
|
+
subject { @file }
|
172
200
|
|
173
201
|
it 'should raise w/o kml data' do
|
174
202
|
expect { subject.to_kml_file }.to raise_error
|
data/spec/session_spec.rb
CHANGED
@@ -4,15 +4,15 @@ describe EagleTree::Log::Session do
|
|
4
4
|
|
5
5
|
context 'data file funjet-gps.fdr' do
|
6
6
|
|
7
|
-
|
7
|
+
before(:all) { @file = funjet_fdr }
|
8
8
|
|
9
|
-
subject { file }
|
9
|
+
subject { @file }
|
10
10
|
|
11
11
|
it { should have(1).sessions }
|
12
12
|
|
13
13
|
context 'session 1' do
|
14
14
|
|
15
|
-
subject { file.sessions[0] }
|
15
|
+
subject { @file.sessions[0] }
|
16
16
|
|
17
17
|
it { should have(2929).rows }
|
18
18
|
|
@@ -21,88 +21,88 @@ describe EagleTree::Log::Session do
|
|
21
21
|
its(:milliseconds?) { should be_true }
|
22
22
|
|
23
23
|
it 'should have a few select milliseconds' do
|
24
|
-
subject.milliseconds[0].
|
25
|
-
subject.milliseconds[125].
|
26
|
-
subject.milliseconds[250].
|
27
|
-
subject.milliseconds[2230].
|
24
|
+
expect(subject.milliseconds[0]).to eql(0)
|
25
|
+
expect(subject.milliseconds[125]).to eql(31250)
|
26
|
+
expect(subject.milliseconds[250]).to eql(62500)
|
27
|
+
expect(subject.milliseconds[2230]).to eql(557500)
|
28
28
|
end
|
29
29
|
|
30
30
|
its(:latitudes?) { should be_true }
|
31
31
|
|
32
32
|
it 'should have a few select latitudes' do
|
33
|
-
subject.latitudes[0].
|
34
|
-
subject.latitudes[1242].
|
35
|
-
subject.latitudes[1666].
|
36
|
-
subject.latitudes[2077].
|
33
|
+
expect(subject.latitudes[0]).to be_within(0.0001).of(49.0775)
|
34
|
+
expect(subject.latitudes[1242]).to be_within(0.0001).of(49.0793)
|
35
|
+
expect(subject.latitudes[1666]).to be_within(0.0001).of(49.0750)
|
36
|
+
expect(subject.latitudes[2077]).to be_within(0.0001).of(49.0771)
|
37
37
|
end
|
38
38
|
|
39
39
|
its(:longitudes?) { should be_true }
|
40
40
|
|
41
41
|
it 'should have a few select longitudes' do
|
42
|
-
subject.longitudes[0].
|
43
|
-
subject.longitudes[1356].
|
44
|
-
subject.longitudes[1727].
|
45
|
-
subject.longitudes[2317].
|
42
|
+
expect(subject.longitudes[0]).to be_within(0.0001).of(2.1545)
|
43
|
+
expect(subject.longitudes[1356]).to be_within(0.0001).of(2.1530)
|
44
|
+
expect(subject.longitudes[1727]).to be_within(0.0001).of(2.1560)
|
45
|
+
expect(subject.longitudes[2317]).to be_within(0.0001).of(2.1519)
|
46
46
|
end
|
47
47
|
|
48
48
|
its(:gps_altitudes?) { should be_true }
|
49
49
|
|
50
50
|
it 'should have a few select gps_altitudes' do
|
51
|
-
subject.gps_altitudes[864].
|
52
|
-
subject.gps_altitudes[1566].
|
53
|
-
subject.gps_altitudes[1879].
|
54
|
-
subject.gps_altitudes[2317].
|
51
|
+
expect(subject.gps_altitudes[864]).to be_within(0.1).of(75.0)
|
52
|
+
expect(subject.gps_altitudes[1566]).to be_within(0.1).of(208.0)
|
53
|
+
expect(subject.gps_altitudes[1879]).to be_within(0.1).of(99.0)
|
54
|
+
expect(subject.gps_altitudes[2317]).to be_within(0.1).of(168.0)
|
55
55
|
end
|
56
56
|
|
57
57
|
its(:coords) { should be_true }
|
58
58
|
|
59
59
|
it 'should have a few select coords' do
|
60
|
-
subject.coords[0][0].
|
61
|
-
subject.coords[0][1].
|
62
|
-
subject.coords[0][2].
|
63
|
-
subject.coords[0][3].
|
64
|
-
subject.coords[500][0].
|
65
|
-
subject.coords[500][1].
|
66
|
-
subject.coords[500][2].
|
67
|
-
subject.coords[500][3].
|
68
|
-
subject.coords[1500][0].
|
69
|
-
subject.coords[1500][1].
|
70
|
-
subject.coords[1500][2].
|
71
|
-
subject.coords[1500][3].
|
72
|
-
subject.coords[2500][0].
|
73
|
-
subject.coords[2500][1].
|
74
|
-
subject.coords[2500][2].
|
75
|
-
subject.coords[2500][3].
|
60
|
+
expect(subject.coords[0][0]).to be_within(0.0001).of(2.1545)
|
61
|
+
expect(subject.coords[0][1]).to be_within(0.0001).of(49.0775)
|
62
|
+
expect(subject.coords[0][2]).to be_within(0.1).of(102.0)
|
63
|
+
expect(subject.coords[0][3]).to be_within(0.1).of(0.0)
|
64
|
+
expect(subject.coords[500][0]).to be_within(0.0001).of(2.1545)
|
65
|
+
expect(subject.coords[500][1]).to be_within(0.0001).of(49.0775)
|
66
|
+
expect(subject.coords[500][2]).to be_within(0.1).of(75.0)
|
67
|
+
expect(subject.coords[500][3]).to be_within(0.1).of(175.7)
|
68
|
+
expect(subject.coords[1500][0]).to be_within(0.0001).of(2.1531)
|
69
|
+
expect(subject.coords[1500][1]).to be_within(0.0001).of(49.0780)
|
70
|
+
expect(subject.coords[1500][2]).to be_within(0.1).of(121.0)
|
71
|
+
expect(subject.coords[1500][3]).to be_within(0.1).of(35.1)
|
72
|
+
expect(subject.coords[2500][0]).to be_within(0.0001).of(2.1542)
|
73
|
+
expect(subject.coords[2500][1]).to be_within(0.0001).of(49.0778)
|
74
|
+
expect(subject.coords[2500][2]).to be_within(0.1).of(89.0)
|
75
|
+
expect(subject.coords[2500][3]).to be_within(0.1).of(8.6)
|
76
76
|
end
|
77
77
|
|
78
78
|
its(:gps_speeds?) { should be_true }
|
79
79
|
|
80
80
|
it 'should have a few select speeds' do
|
81
|
-
subject.gps_speeds[0].
|
82
|
-
subject.gps_speeds[864].
|
83
|
-
subject.gps_speeds[1566].
|
84
|
-
subject.gps_speeds[1879].
|
85
|
-
subject.gps_speeds[2317].
|
81
|
+
expect(subject.gps_speeds[0]).to be_within(0.1).of(0.0)
|
82
|
+
expect(subject.gps_speeds[864]).to be_within(0.1).of(0.7)
|
83
|
+
expect(subject.gps_speeds[1566]).to be_within(0.1).of(194.6)
|
84
|
+
expect(subject.gps_speeds[1879]).to be_within(0.1).of(180.6)
|
85
|
+
expect(subject.gps_speeds[2317]).to be_within(0.1).of(126.7)
|
86
86
|
end
|
87
87
|
|
88
88
|
its(:gps_courses?) { should be_true }
|
89
89
|
|
90
90
|
it 'should have a few select courses' do
|
91
|
-
subject.gps_courses[0].
|
92
|
-
subject.gps_courses[864].
|
93
|
-
subject.gps_courses[1566].
|
94
|
-
subject.gps_courses[1879].
|
95
|
-
subject.gps_courses[2317].
|
91
|
+
expect(subject.gps_courses[0]).to be_within(0.1).of(0.0)
|
92
|
+
expect(subject.gps_courses[864]).to be_within(0.1).of(291.6)
|
93
|
+
expect(subject.gps_courses[1566]).to be_within(0.1).of(197.6)
|
94
|
+
expect(subject.gps_courses[1879]).to be_within(0.1).of(189.1)
|
95
|
+
expect(subject.gps_courses[2317]).to be_within(0.1).of(266.1)
|
96
96
|
end
|
97
97
|
|
98
98
|
its(:gps_satellites?) { should be_true }
|
99
99
|
|
100
100
|
it 'should have a few select satellites' do
|
101
|
-
subject.gps_satellites[0].
|
102
|
-
subject.gps_satellites[864].
|
103
|
-
subject.gps_satellites[1566].
|
104
|
-
subject.gps_satellites[1879].
|
105
|
-
subject.gps_satellites[2317].
|
101
|
+
expect(subject.gps_satellites[0]).to eql(0)
|
102
|
+
expect(subject.gps_satellites[864]).to eql(8)
|
103
|
+
expect(subject.gps_satellites[1566]).to eql(7)
|
104
|
+
expect(subject.gps_satellites[1879]).to eql(7)
|
105
|
+
expect(subject.gps_satellites[2317]).to eql(8)
|
106
106
|
end
|
107
107
|
|
108
108
|
its(:to_kml?) { should be_true }
|
@@ -115,15 +115,15 @@ describe EagleTree::Log::Session do
|
|
115
115
|
|
116
116
|
context 'data file multi-session-1.fdr' do
|
117
117
|
|
118
|
-
|
118
|
+
before(:all) { @file = multi_1_fdr }
|
119
119
|
|
120
|
-
subject { file }
|
120
|
+
subject { @file }
|
121
121
|
|
122
122
|
it { should have(3).sessions }
|
123
123
|
|
124
124
|
context 'session 1' do
|
125
125
|
|
126
|
-
subject { file.sessions[0] }
|
126
|
+
subject { @file.sessions[0] }
|
127
127
|
|
128
128
|
it { should have(3555).rows }
|
129
129
|
|
@@ -132,10 +132,10 @@ describe EagleTree::Log::Session do
|
|
132
132
|
its(:milliseconds?) { should be_true }
|
133
133
|
|
134
134
|
it 'should have a few select milliseconds' do
|
135
|
-
subject.milliseconds[0].
|
136
|
-
subject.milliseconds[125].
|
137
|
-
subject.milliseconds[250].
|
138
|
-
subject.milliseconds[2230].
|
135
|
+
expect(subject.milliseconds[0]).to eql(0)
|
136
|
+
expect(subject.milliseconds[125]).to eql(12500)
|
137
|
+
expect(subject.milliseconds[250]).to eql(25000)
|
138
|
+
expect(subject.milliseconds[2230]).to eql(223000)
|
139
139
|
end
|
140
140
|
|
141
141
|
its(:latitudes?) { should be_false }
|
@@ -156,7 +156,7 @@ describe EagleTree::Log::Session do
|
|
156
156
|
|
157
157
|
context 'session 2' do
|
158
158
|
|
159
|
-
subject { file.sessions[1] }
|
159
|
+
subject { @file.sessions[1] }
|
160
160
|
|
161
161
|
it { should have(3699).rows }
|
162
162
|
|
@@ -165,17 +165,17 @@ describe EagleTree::Log::Session do
|
|
165
165
|
its(:milliseconds?) { should be_true }
|
166
166
|
|
167
167
|
it 'should have a few select milliseconds' do
|
168
|
-
subject.milliseconds[0].
|
169
|
-
subject.milliseconds[125].
|
170
|
-
subject.milliseconds[250].
|
171
|
-
subject.milliseconds[2230].
|
168
|
+
expect(subject.milliseconds[0]).to eql(355500)
|
169
|
+
expect(subject.milliseconds[125]).to eql(368000)
|
170
|
+
expect(subject.milliseconds[250]).to eql(380500)
|
171
|
+
expect(subject.milliseconds[2230]).to eql(578500)
|
172
172
|
end
|
173
173
|
|
174
174
|
end
|
175
175
|
|
176
176
|
context 'session 3' do
|
177
177
|
|
178
|
-
subject { file.sessions[2] }
|
178
|
+
subject { @file.sessions[2] }
|
179
179
|
|
180
180
|
it { should have(4241).rows }
|
181
181
|
|
@@ -187,15 +187,15 @@ describe EagleTree::Log::Session do
|
|
187
187
|
|
188
188
|
context 'data file multi-session-2.fdr' do
|
189
189
|
|
190
|
-
|
190
|
+
before(:all) { @file = multi_2_fdr }
|
191
191
|
|
192
|
-
subject { file }
|
192
|
+
subject { @file }
|
193
193
|
|
194
194
|
it { should have(3).sessions }
|
195
195
|
|
196
196
|
context 'session 1' do
|
197
197
|
|
198
|
-
subject { file.sessions[0] }
|
198
|
+
subject { @file.sessions[0] }
|
199
199
|
|
200
200
|
it { should have(226).rows }
|
201
201
|
|
@@ -211,7 +211,7 @@ describe EagleTree::Log::Session do
|
|
211
211
|
|
212
212
|
context 'session 2' do
|
213
213
|
|
214
|
-
subject { file.sessions[1] }
|
214
|
+
subject { @file.sessions[1] }
|
215
215
|
|
216
216
|
it { should have(124).rows }
|
217
217
|
|
@@ -221,7 +221,7 @@ describe EagleTree::Log::Session do
|
|
221
221
|
|
222
222
|
context 'session 3' do
|
223
223
|
|
224
|
-
subject { file.sessions[2] }
|
224
|
+
subject { @file.sessions[2] }
|
225
225
|
|
226
226
|
it { should have(6336).rows }
|
227
227
|
|
@@ -233,7 +233,9 @@ describe EagleTree::Log::Session do
|
|
233
233
|
|
234
234
|
context 'data file t600-1.fdr' do
|
235
235
|
|
236
|
-
|
236
|
+
before(:all) { @file = t600_1_fdr }
|
237
|
+
|
238
|
+
subject { @file.sessions[0] }
|
237
239
|
|
238
240
|
it { should have(692).rows }
|
239
241
|
|
@@ -250,19 +252,19 @@ describe EagleTree::Log::Session do
|
|
250
252
|
its(:pack_voltages?) { should be_true }
|
251
253
|
|
252
254
|
it 'should have a few select pack voltages' do
|
253
|
-
subject.pack_voltages[0].
|
254
|
-
subject.pack_voltages[100].
|
255
|
-
subject.pack_voltages[250].
|
256
|
-
subject.pack_voltages[500].
|
255
|
+
expect(subject.pack_voltages[0]).to be_within(0.1).of(46.5)
|
256
|
+
expect(subject.pack_voltages[100]).to be_within(0.1).of(46.5)
|
257
|
+
expect(subject.pack_voltages[250]).to be_within(0.1).of(42.8)
|
258
|
+
expect(subject.pack_voltages[500]).to be_within(0.1).of(45.2)
|
257
259
|
end
|
258
260
|
|
259
261
|
its(:amps?) { should be_true }
|
260
262
|
|
261
263
|
it 'should have a few select amps' do
|
262
|
-
subject.amps[0].
|
263
|
-
subject.amps[100].
|
264
|
-
subject.amps[250].
|
265
|
-
subject.amps[500].
|
264
|
+
expect(subject.amps[0]).to be_within(0.01).of(0.18)
|
265
|
+
expect(subject.amps[100]).to be_within(0.01).of(0.31)
|
266
|
+
expect(subject.amps[250]).to be_within(0.01).of(19.40)
|
267
|
+
expect(subject.amps[500]).to be_within(0.01).of(0.12)
|
266
268
|
end
|
267
269
|
|
268
270
|
its(:temps1?) { should be_false }
|
@@ -285,7 +287,9 @@ describe EagleTree::Log::Session do
|
|
285
287
|
|
286
288
|
context 'data file t600-2.fdr' do
|
287
289
|
|
288
|
-
|
290
|
+
before(:all) { @file = t600_2_fdr }
|
291
|
+
|
292
|
+
subject { @file.sessions[0] }
|
289
293
|
|
290
294
|
it { should have(865).rows }
|
291
295
|
|
@@ -302,19 +306,19 @@ describe EagleTree::Log::Session do
|
|
302
306
|
its(:pack_voltages?) { should be_true }
|
303
307
|
|
304
308
|
it 'should have a few select pack voltages' do
|
305
|
-
subject.pack_voltages[0].
|
306
|
-
subject.pack_voltages[100].
|
307
|
-
subject.pack_voltages[250].
|
308
|
-
subject.pack_voltages[500].
|
309
|
+
expect(subject.pack_voltages[0]).to be_within(0.1).of(46.6)
|
310
|
+
expect(subject.pack_voltages[100]).to be_within(0.1).of(46.6)
|
311
|
+
expect(subject.pack_voltages[250]).to be_within(0.1).of(46.6)
|
312
|
+
expect(subject.pack_voltages[500]).to be_within(0.1).of(42.3)
|
309
313
|
end
|
310
314
|
|
311
315
|
its(:amps?) { should be_true }
|
312
316
|
|
313
317
|
it 'should have a few select amps' do
|
314
|
-
subject.amps[0].
|
315
|
-
subject.amps[100].
|
316
|
-
subject.amps[250].
|
317
|
-
subject.amps[500].
|
318
|
+
expect(subject.amps[0]).to be_within(0.01).of(0.18)
|
319
|
+
expect(subject.amps[100]).to be_within(0.01).of(0.0)
|
320
|
+
expect(subject.amps[250]).to be_within(0.01).of(0.0)
|
321
|
+
expect(subject.amps[500]).to be_within(0.01).of(19.9)
|
318
322
|
end
|
319
323
|
|
320
324
|
its(:temps1?) { should be_false }
|
data/spec/spec_helper.rb
CHANGED
@@ -36,3 +36,15 @@ def invalid_data_files
|
|
36
36
|
invalid << __FILE__
|
37
37
|
invalid << 'NOFILE.TLM'
|
38
38
|
end
|
39
|
+
|
40
|
+
def empty_fdr; EagleTree::Log::File.new(data_file('empty.fdr')) end
|
41
|
+
|
42
|
+
def funjet_fdr; EagleTree::Log::File.new(data_file('funjet-gps.fdr')) end
|
43
|
+
|
44
|
+
def multi_1_fdr; EagleTree::Log::File.new(data_file('multi-session-1.fdr')) end
|
45
|
+
|
46
|
+
def multi_2_fdr; EagleTree::Log::File.new(data_file('multi-session-2.fdr')) end
|
47
|
+
|
48
|
+
def t600_1_fdr; EagleTree::Log::File.new(data_file('t600-1.fdr')) end
|
49
|
+
|
50
|
+
def t600_2_fdr; EagleTree::Log::File.new(data_file('t600-2.fdr')) end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eagletree-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Veys
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|