diff options
author | Chris Schlaeger <chris@linux.com> | 2014-11-17 03:11:53 +0100 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2014-11-17 03:11:53 +0100 |
commit | bdc7d05a19747b68d10eb0303c3472571aa3ce61 (patch) | |
tree | ab89ce84a3dfa0879740ea7428b88073ca537902 /spec | |
parent | 70fa9815704d2552d9f24e1051566ad7773fda48 (diff) | |
download | postrunner-bdc7d05a19747b68d10eb0303c3472571aa3ce61.zip |
New: Add 'set' option to change name, type and subtype of activities.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/PostRunner_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/PostRunner_spec.rb b/spec/PostRunner_spec.rb index ac67c80..e146e3f 100644 --- a/spec/PostRunner_spec.rb +++ b/spec/PostRunner_spec.rb @@ -113,6 +113,39 @@ describe PostRunner::Main do list.index('foobar').should be_a(Fixnum) end + it 'should fail when setting bad attribute' do + lambda { postrunner(%w( set foo bar :1)) }.should raise_error SystemExit + end + + it 'should set name for FILE2.FIT activity' do + postrunner(%w( set name foobar :1 )) + list = postrunner(%w( list )) + list.index('FILE2.FIT').should be_nil + list.index('foobar').should be_a(Fixnum) + end + + it 'should set activity type for FILE2.FIT activity' do + postrunner(%w( set type Cycling :1 )) + list = postrunner(%w( summary :1 )) + list.index('Running').should be_nil + list.index('Cycling').should be_a(Fixnum) + end + + it 'should fail when setting bad activity type' do + lambda { postrunner(%w( set type foobar :1)) }.should raise_error SystemExit + end + + it 'should set activity subtype for FILE2.FIT activity' do + postrunner(%w( set subtype Road :1 )) + list = postrunner(%w( summary :1 )) + list.index('Generic').should be_nil + list.index('Road').should be_a(Fixnum) + end + + it 'should fail when setting bad activity subtype' do + lambda { postrunner(%w( set subtype foobar :1)) }.should raise_error SystemExit + end + it 'should dump an activity from the archive' do postrunner(%w( dump :1 )) end |