summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/ActivitySummary_spec.rb2
-rw-r--r--spec/FlexiTable_spec.rb1
-rw-r--r--spec/PostRunner_spec.rb3
-rw-r--r--spec/View_spec.rb1
-rw-r--r--spec/spec_helper.rb7
5 files changed, 12 insertions, 2 deletions
diff --git a/spec/ActivitySummary_spec.rb b/spec/ActivitySummary_spec.rb
index 08e2b15..b3d77b0 100644
--- a/spec/ActivitySummary_spec.rb
+++ b/spec/ActivitySummary_spec.rb
@@ -10,8 +10,8 @@
# published by the Free Software Foundation.
#
-require 'postrunner/ActivitySummary'
require 'spec_helper'
+require 'postrunner/ActivitySummary'
class Activity < Struct.new(:fit_activity, :sport)
end
diff --git a/spec/FlexiTable_spec.rb b/spec/FlexiTable_spec.rb
index 5a03c56..c3357cd 100644
--- a/spec/FlexiTable_spec.rb
+++ b/spec/FlexiTable_spec.rb
@@ -10,6 +10,7 @@
# published by the Free Software Foundation.
#
+require 'spec_helper'
require 'postrunner/FlexiTable'
describe PostRunner::FlexiTable do
diff --git a/spec/PostRunner_spec.rb b/spec/PostRunner_spec.rb
index e146e3f..4ca5a4a 100644
--- a/spec/PostRunner_spec.rb
+++ b/spec/PostRunner_spec.rb
@@ -12,8 +12,8 @@
require 'fileutils'
-require 'postrunner/Main'
require 'spec_helper'
+require 'postrunner/Main'
describe PostRunner::Main do
@@ -38,6 +38,7 @@ describe PostRunner::Main do
FileUtils.rm_rf(@db_dir)
FileUtils.rm_rf('FILE1.FIT')
FileUtils.rm_rf('FILE2.FIT')
+ FileUtils::rm_rf('icons')
end
it 'should abort without arguments' do
diff --git a/spec/View_spec.rb b/spec/View_spec.rb
index 7a90a01..538b71f 100644
--- a/spec/View_spec.rb
+++ b/spec/View_spec.rb
@@ -10,6 +10,7 @@
# published by the Free Software Foundation.
#
+require 'spec_helper'
require 'postrunner/View'
require 'postrunner/ViewButtons'
require 'postrunner/PagingButtons'
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 7c15dbb..691f097 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -10,6 +10,13 @@
# published by the Free Software Foundation.
#
+# Some dependencies may not be installed as Ruby Gems but as local sources.
+# Add them and the postrunner dir to the LOAD_PATH.
+%w( postrunner fit4ruby perobs ).each do |lib_dir|
+ $:.unshift(File.join(File.dirname(__FILE__), '..', '..', lib_dir, 'lib'))
+end
+puts $:
+
def create_fit_file(name, date, duration_minutes = 30)
Fit4Ruby.write(name, create_fit_activity(date, duration_minutes))
end