Sha256: 1b682cf2418e886c3efb6d1a755fb1c6672ff876ab5d8a51d65d8fe28e1b5a32

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

require 'rubygems'
require 'log4r'
require 'fakefs/spec_helpers'
require_relative '../lib/depengine/processor/fileops'
require_relative '../lib/depengine/log/log'

$log       = Log::DeploymentLogger.new
$log.writer.level = Log4r::ERROR

describe 'file operations' do
  include FakeFS::SpecHelpers
  include Processor

  it 'should copy a file' do
    FileUtils.mkdir_p 'source'
    FileUtils.mkdir_p 'target'
    FileUtils.touch 'source/dummy.file'

    copy('source/dummy.file', 'target/dummy.file')
    File.file?('target/dummy.file').should be_true
  end

  it 'should create a directory' do
    mkdir('target')
    File.directory?('target').should be_true
  end

  it 'should modifie file parameter' do
    # not testable with FakeFS
  end

  it 'should delete a file' do
    FileUtils.touch 'dummy.file'
    remove('dummy.file')
    File.file?('dummy.file').should be_false
  end

  it 'should delete a directory' do
    FileUtils.mkdir_p 'dummy'
    remove('dummy')

    File.directory?('dummy').should be_false
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
depengine-3.0.23 spec/fileops_spec.rb
depengine-3.0.22 spec/fileops_spec.rb
depengine-3.0.21 spec/fileops_spec.rb