fossil 0.3.23 → 0.3.24
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fossil.gemspec +3 -1
- data/lib/models/trip_leg.rb +704 -692
- data/spec/models/trip_leg_spec.rb +32 -0
- data/spec/spec_helper.rb +1 -0
- metadata +3 -1
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe TripLeg do
|
4
|
+
|
5
|
+
before do
|
6
|
+
end
|
7
|
+
|
8
|
+
it "actual take off date_time dates are after dept_date_act_gmt if take off time is less than depart time" do
|
9
|
+
dept_date_act_gmt = Date.new(1900,1,1)
|
10
|
+
tl = TripLeg.new(:dept_date_act_gmt=>dept_date_act_gmt.to_fos_days,:t_o_time_act_gmt=>20,:dept_time_act_gmt=>1420)
|
11
|
+
tl.actual_takeoff_date_time_gmt.should == DateTime.new(1900,1,2,0,20,0)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "actual take off date_time dates are the same as dept_date_act_gmt if take off time is not less than depart time" do
|
15
|
+
dept_date_act_gmt = Date.new(1900,1,1)
|
16
|
+
tl = TripLeg.new(:dept_date_act_gmt=>dept_date_act_gmt.to_fos_days,:t_o_time_act_gmt=>40,:dept_time_act_gmt=>20)
|
17
|
+
tl.actual_takeoff_date_time_gmt.should == DateTime.new(1900,1,1,0,40,0)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "actual landing date_time dates are before arr_date_act_gmt if on time time is greater than landing time" do
|
21
|
+
arr_date_act_gmt = Date.new(1900,1,2)
|
22
|
+
tl = TripLeg.new(:arrival_date_gmt=>arr_date_act_gmt.to_fos_days,:land_time_act_gmt=>1420,:arriv_time_act_gmt=>20)
|
23
|
+
tl.actual_land_date_time_gmt.should == DateTime.new(1900,1,1,23,40,0)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "actual landing date_time dates are the same as arr_date_act_gmt if on time time is not greater than landing time" do
|
27
|
+
arr_date_act_gmt = Date.new(1900,1,2)
|
28
|
+
tl = TripLeg.new(:arrival_date_gmt=>arr_date_act_gmt.to_fos_days,:land_time_act_gmt=>20,:arriv_time_act_gmt=>40)
|
29
|
+
tl.actual_land_date_time_gmt.should == DateTime.new(1900,1,2,0,20,0)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fossil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Lardin, Daniel Sudol
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- spec/helper_classes.rb
|
171
171
|
- spec/helper_methods.rb
|
172
172
|
- spec/models/code_spec.rb
|
173
|
+
- spec/models/trip_leg_spec.rb
|
173
174
|
- spec/models/trip_spec.rb
|
174
175
|
- spec/models/vendor_document_spec.rb
|
175
176
|
- spec/sequel/fos_dates_spec.rb
|
@@ -221,6 +222,7 @@ test_files:
|
|
221
222
|
- spec/sequel/pervasive_adapter_spec.rb
|
222
223
|
- spec/helper_classes.rb
|
223
224
|
- spec/models/code_spec.rb
|
225
|
+
- spec/models/trip_leg_spec.rb
|
224
226
|
- spec/models/vendor_document_spec.rb
|
225
227
|
- spec/models/trip_spec.rb
|
226
228
|
- spec/be_model_with_values_matcher.rb
|