Sha256: eaca983b45fb4ee40207054fb9f2f37c2458ec1234632a27e2a5d21228cefbff

Contents?: true

Size: 645 Bytes

Versions: 10

Compression:

Stored size: 645 Bytes

Contents

require 'spec_helper'
require 'projectdx_pipeline/file'

describe ProjectdxPipeline::File do
  describe '#copy' do
    before(:each) do
      ::File.stub!(:exist? => false)
      FileUtils.stub!(:cp)
    end

    it 'copies the source file to the destination' do
      FileUtils.should_receive(:cp).with('foo', 'bar')
      ProjectdxPipeline::File.copy('foo', 'bar')
    end

    it 'makes a backup copy of the destination file if it already exists' do
      ::File.should_receive(:exist?).with('bar').and_return(true)
      FileUtils.should_receive(:cp).with('bar', 'bar.bak')
      ProjectdxPipeline::File.copy('foo', 'bar')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
projectdx_pipeline-1.3.6 spec/file_spec.rb
projectdx_pipeline-1.3.5 spec/file_spec.rb
projectdx_pipeline-1.3.4 spec/file_spec.rb
projectdx_pipeline-1.3.0 spec/file_spec.rb
projectdx_pipeline-1.2.2 spec/file_spec.rb
projectdx_pipeline-1.2.1 spec/file_spec.rb
projectdx_pipeline-1.2.0 spec/file_spec.rb
projectdx_pipeline-1.1.0 spec/file_spec.rb
projectdx_pipeline-1.0.0 spec/file_spec.rb
projectdx_pipeline-0.2.0 spec/file_spec.rb