spec/FitFile_spec.rb in fit4ruby-0.0.5 vs spec/FitFile_spec.rb in fit4ruby-0.0.6

- old
+ new

@@ -1,11 +1,11 @@ #!/usr/bin/env ruby -w # encoding: UTF-8 # # = FitFile_spec.rb -- Fit4Ruby - FIT file processing library for Ruby # -# Copyright (c) 2014 by Chris Schlaeger <cs@taskjuggler.org> +# Copyright (c) 2014, 2015 by Chris Schlaeger <cs@taskjuggler.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # @@ -20,12 +20,12 @@ a.new_user_profile({ :age => 33, :height => 1.78, :weight => 73.0, :gender => 'male', :activity_class => 4.0, :max_hr => 178 }) a.new_event({ :event => 'timer', :event_type => 'start_time' }) - a.new_device_info({ :device_index => 0, :manufacturer => 'garmin' }) - a.new_device_info({ :device_index => 1, :manufacturer => 'garmin', + a.new_device_info({ :device_index => 0, :manufacturer => 'development' }) + a.new_device_info({ :device_index => 1, :manufacturer => 'development', :battery_status => 'ok' }) ts = Time.now 0.upto(a.total_timer_time / 60) do |mins| ts += 60 a.new_record({ @@ -56,23 +56,23 @@ a.new_event({ :timestamp => ts, :event => 'vo2max', :event_type => 'marker', :vo2max => 52 }) a.new_event({ :timestamp => ts, :event => 'timer', :event_type => 'stop_all' }) a.new_device_info({ :timestamp => ts, :device_index => 0, - :manufacturer => 'garmin' }) + :manufacturer => 'development' }) ts += 1 - a.new_device_info({ :timestamp => ts, :manufacturer => 'garmin', + a.new_device_info({ :timestamp => ts, :manufacturer => 'development', :device_index => 1, :battery_status => 'low' }) ts += 120 a.new_event({ :timestamp => ts, :event => 'recovery_hr', :event_type => 'marker', :recovery_hr => 132 }) a.aggregate @activity = a end - it 'should write a simple FIT file and read it back' do + it 'should write an Activity FIT file and read it back' do fit_file = 'test.fit' File.delete(fit_file) if File.exists?(fit_file) Fit4Ruby.write(fit_file, @activity) File.exists?(fit_file).should be_true