spektrum-log 0.0.15 → 0.0.16
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 +7 -0
- data/lib/spektrum/log.rb +1 -1
- data/lib/spektrum/log/{reader.rb → file.rb} +22 -1
- data/lib/spektrum/log/version.rb +1 -1
- data/{data → spec/data}/1.TLM +0 -0
- data/{data → spec/data}/2.TLM +0 -0
- data/{data → spec/data}/3.TLM +0 -0
- data/{data → spec/data}/4.TLM +0 -0
- data/{data → spec/data}/GPS.TLM +0 -0
- data/{data → spec/data}/GPS2.TLM +0 -0
- data/{data → spec/data}/X5-GPS1.TLM +0 -0
- data/{data → spec/data}/X5-GPS2.TLM +0 -0
- data/spec/data/X5-GPS3.TLM +0 -0
- data/spec/data/invalid/castle/long-flight.csv +2853 -0
- data/spec/data/invalid/castle/multi-line-notes.csv +4607 -0
- data/spec/data/invalid/castle/multi-session-1.csv +972 -0
- data/spec/data/invalid/castle/multi-session-2.csv +5457 -0
- data/spec/data/invalid/castle/sample-1.csv +584 -0
- data/spec/data/invalid/eagle_tree/empty.fdr +5 -0
- data/spec/data/invalid/eagle_tree/funjet-gps.fdr +2936 -0
- data/spec/data/invalid/eagle_tree/multi-session-1.fdr +11506 -0
- data/spec/data/invalid/eagle_tree/multi-session-2.fdr +6698 -0
- data/spec/data/invalid/eagle_tree/old-1.fdr +2215 -0
- data/spec/data/invalid/eagle_tree/old-2.fdr +7794 -0
- data/spec/data/invalid/eagle_tree/old-3.fdr +8723 -0
- data/spec/data/invalid/eagle_tree/t600-1.fdr +699 -0
- data/spec/data/invalid/eagle_tree/t600-2.fdr +872 -0
- data/spec/data/invalid/empty.file +0 -0
- data/spec/file_spec.rb +120 -0
- data/spec/flight_spec.rb +16 -16
- data/spec/spec_helper.rb +15 -3
- metadata +66 -52
- data/spec/reader_spec.rb +0 -93
data/spec/reader_spec.rb
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spektrum::Log::Reader do
|
4
|
-
|
5
|
-
context 'data file 1.TLM' do
|
6
|
-
|
7
|
-
subject { Spektrum::Log::Reader.new(data_file('1.TLM')) }
|
8
|
-
|
9
|
-
it { should have(3).flights }
|
10
|
-
|
11
|
-
its(:duration) { should be_within(0.1).of(34.3) }
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'data file 2.TLM' do
|
16
|
-
|
17
|
-
subject { Spektrum::Log::Reader.new(data_file('2.TLM')) }
|
18
|
-
|
19
|
-
it { should have(312).flights }
|
20
|
-
|
21
|
-
its(:duration) { should be_within(0.1).of(1570.7) }
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
context 'data file 3.TLM' do
|
26
|
-
|
27
|
-
subject { Spektrum::Log::Reader.new(data_file('3.TLM')) }
|
28
|
-
|
29
|
-
it { should have(12).flights }
|
30
|
-
|
31
|
-
its(:duration) { should be_within(0.1).of(144.8) }
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'data file 4.TLM' do
|
36
|
-
|
37
|
-
subject { Spektrum::Log::Reader.new(data_file('4.TLM')) }
|
38
|
-
|
39
|
-
it { should have(1).flights }
|
40
|
-
|
41
|
-
its(:duration) { should be_within(0.1).of(15.9) }
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
context 'data file GPS.TLM' do
|
46
|
-
|
47
|
-
subject { Spektrum::Log::Reader.new(data_file('GPS.TLM')) }
|
48
|
-
|
49
|
-
it { should have(2).flights }
|
50
|
-
|
51
|
-
its(:duration) { should be_within(0.1).of(1431.4) }
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
context 'data file GPS2.TLM' do
|
56
|
-
|
57
|
-
subject { Spektrum::Log::Reader.new(data_file('GPS2.TLM')) }
|
58
|
-
|
59
|
-
it { should have(2).flights }
|
60
|
-
|
61
|
-
its(:duration) { should be_within(0.1).of(851.0) }
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
context 'data file X5-GPS1.TLM' do
|
66
|
-
|
67
|
-
subject { Spektrum::Log::Reader.new(data_file('X5-GPS1.TLM')) }
|
68
|
-
|
69
|
-
it { should have(5).flights }
|
70
|
-
|
71
|
-
its(:duration) { should be_within(0.1).of(1305.2) }
|
72
|
-
|
73
|
-
end
|
74
|
-
|
75
|
-
context 'data file X5-GPS2.TLM' do
|
76
|
-
|
77
|
-
subject { Spektrum::Log::Reader.new(data_file('X5-GPS2.TLM')) }
|
78
|
-
|
79
|
-
it { should have(2).flights }
|
80
|
-
|
81
|
-
its(:duration) { should be_within(0.1).of(627.7) }
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'should raise on bad input' do
|
86
|
-
expect { Spektrum::Log::Reader.new(__FILE__) }.to raise_error
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'should raise when file is not found' do
|
90
|
-
expect { Spektrum::Log::Reader.new(data_file('NOFILE.TLM')) }.to raise_error
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|