Some work on cache_check and cache_restore

This commit is contained in:
Joe Thornber
2013-08-16 16:29:41 +01:00
parent 5fa1c0a212
commit 4360c8cbff
5 changed files with 155 additions and 21 deletions

View File

@@ -0,0 +1,48 @@
Feature: thin_restore
Scenario: print version (-V flag)
When I run cache_restore with -V
Then it should pass with version
Scenario: print version (--version flag)
When I run cache_restore with --version
Then it should pass with version
Scenario: print help (-h)
When I run cache_restore with -h
Then it should pass with:
"""
Usage: cache_restore [options]
Options:
{-h|--help}
{-i|--input} <input xml file>
{-o|--output} <output device or file>
{-V|--version}
"""
Scenario: print help (--help)
When I run cache_restore with -h
Then it should pass with:
"""
Usage: cache_restore [options]
Options:
{-h|--help}
{-i|--input} <input xml file>
{-o|--output} <output device or file>
{-V|--version}
"""
Scenario: missing input file
When I run cache_restore with -o metadata.bin
Then it should fail with:
"""
No input file provided.
"""
Scenario: missing output file
When I run cache_restore with -i metadata.xml
Then it should fail with:
"""
No output file provided.
"""

View File

@@ -55,3 +55,12 @@ end
Then /^usage to stderr$/ do
assert_partial_output(USAGE, all_stderr)
end
When(/^I run cache_check with (.*?)$/) do |opts|
run_simple("cache_check #{opts} #{dev_file}", false)
end
When(/^I run cache_restore with (.*?)$/) do |opts|
run_simple("cache_restore #{opts}", false)
end