Sha256: c113d0b13b4cf335be44ac19f94b2b105e3944171b5ed8d24dfef31e6f0e1c17

Contents?: true

Size: 899 Bytes

Versions: 18

Compression:

Stored size: 899 Bytes

Contents

include Rake
include Rake::Funnel::Support

describe Rake::Funnel::Tasks::Copy do
  before {
    Task.clear
  }

  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 {
      allow(finder).to receive(:all_or_default).and_return(source)
      allow(Finder).to receive(:new).and_return(finder)
    }

    before {
      allow(Copier).to receive(:copy)
    }

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

    before {
      Task[subject.name].invoke
    }

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rake-funnel-0.18.0 spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.17.0 spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.16.1 spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.16.0 spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.15.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.14.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.13.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.12.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.11.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.10.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.9.1.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.9.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.8.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.7.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.6.1.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.6.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.5.0.pre spec/rake/funnel/tasks/copy_spec.rb
rake-funnel-0.4.0.pre spec/rake/funnel/tasks/copy_spec.rb