Sha256: 441e64846134a214dce0e3879ecdc9a59022e211f07dd6fade77b95268ff1a1a

Contents?: true

Size: 914 Bytes

Versions: 5

Compression:

Stored size: 914 Bytes

Contents

include Rake
include Rake::Funnel::Support

describe Rake::Funnel::Tasks::Copy do
  before do
    Task.clear
  end

  describe 'defaults' do
    its(:name) { should == :copy }
    its(:source) { should eq([]) }
    its(:target) { should be_nil }
  end

  describe 'execution' do
    let(:source) { %w(one two) }
    let(:target) { 'target' }
    let(:finder) { instance_double(Finder).as_null_object }

    before do
      allow(finder).to receive(:all_or_default).and_return(source)
      allow(Finder).to receive(:new).and_return(finder)
    end

    before do
      allow(Copier).to receive(:copy)
    end

    subject do
      described_class.new do |t|
        t.source = source
        t.target = target
      end
    end

    before do
      Task[subject.name].invoke
    end

    it 'should delegate to Copier' do
      expect(Copier).to have_received(:copy).with(source, subject.target)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rake-funnel-0.21.0 spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.20.2 spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.20.1 spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.20.0 spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.19.0 spec/rake/funnel/tasks/copy_spec.rb