Sha256: 5dfc0072c64631990436405b1e7f0f9fc4249147c6c663959317944c6693c088

Contents?: true

Size: 552 Bytes

Versions: 4

Compression:

Stored size: 552 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Imap::Backup::Serializer::Base do
  context '#initialize' do
    let(:stat) { stub('File::Stat', :mode => 0345) }

    it 'should fail if file permissions are to lax' do
      File.stub!(:exist?).with('/base/path').and_return(true)
      File.should_receive(:stat).with('/base/path').and_return(stat)

      expect do
        Imap::Backup::Serializer::Base.new('/base/path', 'my_folder')
      end.to raise_error(RuntimeError, "Permissions on '/base/path' should be 0700, not 0345")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
imap-backup-1.0.9 spec/unit/serializer/base_spec.rb
imap-backup-1.0.8 spec/unit/serializer/base_spec.rb
imap-backup-1.0.7 spec/unit/serializer/base_spec.rb
imap-backup-1.0.6 spec/unit/serializer/base_spec.rb