2014-08-27 18:31:31 +05:30
|
|
|
Feature: era_restore
|
2014-08-21 15:57:52 +05:30
|
|
|
Scenario: print version (-V flag)
|
|
|
|
When I run era_restore with -V
|
|
|
|
Then it should pass with version
|
|
|
|
|
|
|
|
Scenario: print version (--version flag)
|
|
|
|
When I run era_restore with --version
|
|
|
|
Then it should pass with version
|
|
|
|
|
|
|
|
Scenario: print help (-h)
|
|
|
|
When I run era_restore with -h
|
|
|
|
Then it should pass
|
|
|
|
And the output should contain exactly:
|
|
|
|
|
|
|
|
"""
|
|
|
|
Usage: era_restore [options]
|
|
|
|
Options:
|
|
|
|
{-h|--help}
|
|
|
|
{-i|--input} <input xml file>
|
|
|
|
{-o|--output} <output device or file>
|
2014-08-26 17:35:21 +05:30
|
|
|
{-q|--quiet}
|
2014-08-21 15:57:52 +05:30
|
|
|
{-V|--version}
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: print help (--help)
|
|
|
|
When I run era_restore with -h
|
|
|
|
Then it should pass
|
|
|
|
And the output should contain exactly:
|
|
|
|
|
|
|
|
"""
|
|
|
|
Usage: era_restore [options]
|
|
|
|
Options:
|
|
|
|
{-h|--help}
|
|
|
|
{-i|--input} <input xml file>
|
|
|
|
{-o|--output} <output device or file>
|
2014-08-26 17:35:21 +05:30
|
|
|
{-q|--quiet}
|
2014-08-21 15:57:52 +05:30
|
|
|
{-V|--version}
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: missing input file
|
|
|
|
Given the dev file metadata.bin
|
|
|
|
When I run era_restore with -o metadata.bin
|
|
|
|
Then it should fail with:
|
|
|
|
"""
|
|
|
|
No input file provided.
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: input file not found
|
|
|
|
Given the dev file metadata.bin
|
|
|
|
When I run era_restore with -i foo.xml -o metadata.bin
|
|
|
|
Then it should fail
|
|
|
|
|
|
|
|
Scenario: missing output file
|
|
|
|
When I run era_restore with -i metadata.xml
|
|
|
|
Then it should fail with:
|
|
|
|
"""
|
|
|
|
No output file provided.
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: successfully restores a valid xml file
|
|
|
|
Given a small era xml file
|
|
|
|
And an empty dev file
|
|
|
|
When I run era_restore with -i metadata.xml -o metadata.bin
|
|
|
|
Then it should pass
|
|
|
|
And the metadata should be valid
|
2014-08-26 17:35:21 +05:30
|
|
|
|
|
|
|
Scenario: --quiet is accepted
|
2014-08-27 18:31:31 +05:30
|
|
|
Given valid era metadata
|
|
|
|
When I run era_restore with -i metadata.xml -o metadata.bin --quiet
|
2014-08-28 18:30:08 +05:30
|
|
|
Then it should pass
|
|
|
|
And the output should contain exactly:
|
2014-08-26 17:35:21 +05:30
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: -q is accepted
|
2014-08-27 18:31:31 +05:30
|
|
|
Given valid era metadata
|
|
|
|
When I run era_restore with -i metadata.xml -o metadata.bin -q
|
2014-08-28 18:30:08 +05:30
|
|
|
Then it should pass
|
|
|
|
And the output should contain exactly:
|
2014-08-26 17:35:21 +05:30
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
2014-09-01 19:15:52 +05:30
|
|
|
Scenario: dump/restore is a noop
|
|
|
|
Given valid era metadata
|
|
|
|
When I era dump
|
|
|
|
And I era restore
|
|
|
|
And I era dump
|
|
|
|
Then dumps 1 and 2 should be identical
|
|
|
|
|
|
|
|
Scenario: dump matches original metadata
|
|
|
|
Given valid era metadata
|
|
|
|
When I era dump
|
|
|
|
Then dumps 0 and 1 should be identical
|