summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2016-01-17 05:46:08 +0100
committerChris Schlaeger <chris@linux.com>2016-01-17 05:46:08 +0100
commited1d5cde7f92d9d7c7de28aa4b516da3e0baf8e5 (patch)
treec6d9eb0720c260cad354d152d7e8c6633458773c /spec/spec_helper.rb
parent998bc46bdf995963a237fccf51e75317d08cd608 (diff)
downloadpostrunner-ed1d5cde7f92d9d7c7de28aa4b516da3e0baf8e5.zip
Wrapping up switch to PEROBS as database back-end.
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index dba6be6..2d93e12 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -96,14 +96,17 @@ def create_fit_activity(config)
:garmin_product => 'sdm4',
:device_index => 1, :battery_status => 'ok' })
laps = 0
+ curr_speed = (config[:speed] ? config[:speed] : 10.0) / 3.6 # as m/s
+ curr_distance = 0.0 # as m
0.upto((a.total_timer_time / 60) - 1) do |mins|
+ curr_speed -= 0.05 if curr_speed > 2.5
a.new_record({
:timestamp => ts,
:position_lat => 51.5512 - mins * 0.0008,
:position_long => 11.647 + mins * 0.002,
- :distance => 200.0 * mins,
+ :distance => curr_distance += curr_speed * 60,
:altitude => 100 + mins * 3,
- :speed => 3.1,
+ :speed => curr_speed,
:vertical_oscillation => 90 + mins * 0.2,
:stance_time => 235.0 * mins * 0.01,
:stance_time_percent => 32.0,