summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2014-07-28 22:01:42 +0200
committerChris Schlaeger <chris@linux.com>2014-07-28 22:01:42 +0200
commit0e6e0f98cd89f136fdb5f098ca4e829f5f8af97a (patch)
tree4880291bbb0d359a700f0f118101e9bdf3d88d97 /test
parent4f742d6a95c4c936cff891dc5f64c177201a4139 (diff)
downloadpostrunner-0e6e0f98cd89f136fdb5f098ca4e829f5f8af97a.zip
Adding summary report and more testing
Diffstat (limited to 'test')
-rw-r--r--test/.PostRunner_spec.rb.swpbin12288 -> 12288 bytes
-rw-r--r--test/PostRunner_spec.rb43
2 files changed, 42 insertions, 1 deletions
diff --git a/test/.PostRunner_spec.rb.swp b/test/.PostRunner_spec.rb.swp
index db98879..cfe7b69 100644
--- a/test/.PostRunner_spec.rb.swp
+++ b/test/.PostRunner_spec.rb.swp
Binary files differ
diff --git a/test/PostRunner_spec.rb b/test/PostRunner_spec.rb
index 31e1510..1c803e9 100644
--- a/test/PostRunner_spec.rb
+++ b/test/PostRunner_spec.rb
@@ -25,12 +25,13 @@ describe PostRunner::Main do
FileUtils.rm_rf(@db_dir)
FileUtils.rm_rf('FILE1.FIT')
create_fit_file('FILE1.FIT', '2014-07-01-8:00')
- #create_fit_file('FILE2.FIT', '2014-07-02-8:00')
+ create_fit_file('FILE2.FIT', '2014-07-02-8:00')
end
after(:all) do
FileUtils.rm_rf(@db_dir)
FileUtils.rm_rf('FILE1.FIT')
+ FileUtils.rm_rf('FILE2.FIT')
end
it 'should abort without arguments' do
@@ -61,9 +62,49 @@ describe PostRunner::Main do
postrunner(%w( check :1 ))
end
+ it 'should check a FIT file' do
+ postrunner(%w( check FILE2.FIT ))
+ end
+
it 'should list the imported file' do
postrunner(%w( list )).index('FILE1.FIT').should be_a(Fixnum)
end
+ it 'should import another FIT file' do
+ postrunner(%w( import FILE2.FIT ))
+ list = postrunner(%w( list ))
+ list.index('FILE1.FIT').should be_a(Fixnum)
+ list.index('FILE2.FIT').should be_a(Fixnum)
+ end
+
+ it 'should delete the first file' do
+ postrunner(%w( delete :2 ))
+ list = postrunner(%w( list ))
+ list.index('FILE1.FIT').should be_nil
+ list.index('FILE2.FIT').should be_a(Fixnum)
+ end
+
+ it 'should not import the deleted file again' do
+ postrunner(%w( import . ))
+ list = postrunner(%w( list ))
+ list.index('FILE1.FIT').should be_nil
+ list.index('FILE2.FIT').should be_a(Fixnum)
+ end
+
+ it 'should rename FILE2.FIT activity' do
+ postrunner(%w( rename :1 --name foobar ))
+ list = postrunner(%w( list ))
+ list.index('FILE2.FIT').should be_nil
+ list.index('foobar').should be_a(Fixnum)
+ end
+
+ it 'should dump an activity from the archive' do
+ postrunner(%w( dump :1 ))
+ end
+
+ it 'should dump a FIT file' do
+ postrunner(%w( dump FILE1.FIT ))
+ end
+
end