fossil 0.3.23 → 0.3.24

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.
@@ -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
@@ -1,6 +1,7 @@
1
1
  require 'lib/fossil'
2
2
  require 'spec'
3
3
  require 'rr'
4
+ require 'pp'
4
5
 
5
6
  unless defined?(DB_DEMO)
6
7
  DB_DEMO = Sequel.odbc('demodata')#, :loggers=>[Logger.new($stdout)])
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.23
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