spec/webtranslateit/safe/archive_spec.rb in webtranslateit-safe-0.4.0 vs spec/webtranslateit/safe/archive_spec.rb in webtranslateit-safe-0.4.1
- old
+ new
@@ -2,13 +2,13 @@
describe WebTranslateIt::Safe::Archive do
def def_config
{
- options: 'OPTS',
- files: 'apples',
- exclude: 'oranges'
+ :options => 'OPTS',
+ :files => 'apples',
+ :exclude => 'oranges'
}
end
def archive(id = :foo, config = def_config)
WebTranslateIt::Safe::Archive.new(id, WebTranslateIt::Safe::Config::Node.new(nil, config))
@@ -17,51 +17,51 @@
after(:each) { WebTranslateIt::Safe::TmpFile.cleanup }
describe :backup do
before(:each) do
@archive = archive
- stub(@archive).timestamp { 'NOW' }
+ stub(@archive).timestamp {'NOW'}
end
{
- id: 'foo',
- kind: 'archive',
- extension: '.tar',
- filename: 'archive-foo.NOW',
- command: 'tar -cf - OPTS --exclude=oranges apples'
+ :id => 'foo',
+ :kind => 'archive',
+ :extension => '.tar',
+ :filename => 'archive-foo.NOW',
+ :command => 'tar -cf - OPTS --exclude=oranges apples',
}.each do |k, v|
- it "sets #{k} to #{v}" do
+ it "should set #{k} to #{v}" do
@archive.backup.send(k).should == v
end
end
end
describe :tar_exclude_files do
- it "returns '' when no excludes" do
+ it "should return '' when no excludes" do
archive(:foo, {}).send(:tar_exclude_files).should == ''
end
- it 'accepts single exclude as string' do
- archive(:foo, {exclude: 'bar'}).send(:tar_exclude_files).should == '--exclude=bar'
+ it 'should accept single exclude as string' do
+ archive(:foo, {:exclude => 'bar'}).send(:tar_exclude_files).should == '--exclude=bar'
end
- it 'accepts multiple exclude as array' do
- archive(:foo, {exclude: ['foo', 'bar']}).send(:tar_exclude_files).should == '--exclude=foo --exclude=bar'
+ it 'should accept multiple exclude as array' do
+ archive(:foo, {:exclude => ['foo', 'bar']}).send(:tar_exclude_files).should == '--exclude=foo --exclude=bar'
end
end
describe :tar_files do
- it 'raises RuntimeError when no files' do
+ it 'should raise RuntimeError when no files' do
lambda {
archive(:foo, {}).send(:tar_files)
}.should raise_error(RuntimeError, 'missing files for tar')
end
- it 'accepts single file as string' do
- archive(:foo, {files: 'foo'}).send(:tar_files).should == 'foo'
+ it 'should accept single file as string' do
+ archive(:foo, {:files => 'foo'}).send(:tar_files).should == 'foo'
end
- it 'accepts multiple files as array' do
- archive(:foo, {files: ['foo', 'bar']}).send(:tar_files).should == 'foo bar'
+ it 'should accept multiple files as array' do
+ archive(:foo, {:files => ['foo', 'bar']}).send(:tar_files).should == 'foo bar'
end
end
end