Sha256: 9ecdf26344610ba0a5d746f53ce57432ed19167fa541329b3edd8358fc77a8d2

Contents?: true

Size: 1.16 KB

Versions: 12

Compression:

Stored size: 1.16 KB

Contents

include Rake
include Rake::Funnel::Support

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

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

  describe 'execution' do
    let(:source) { %w(bin/1 bin/2 bin/3/4) }
    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(Zipper).to receive(:zip)
      allow(Rake).to receive(:rake_output_message)
    }

    subject {
      described_class.new do |t|
        t.source = source
        t.target = 'some path/file.zip'
        t.zip_root = 'zip root'
      end
    }

    before {
      Task[subject.name].invoke
    }

    it 'should delegate to Zipper' do
      expect(Zipper).to have_received(:zip).with(subject.source, subject.target, subject.zip_root)
    end

    it 'should report the created zip file' do
      expect(Rake).to have_received(:rake_output_message).with("Created #{subject.target}")
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rake-funnel-0.13.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.12.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.11.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.10.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.9.1.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.9.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.8.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.7.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.6.1.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.6.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.5.0.pre spec/rake/funnel/tasks/zip_spec.rb
rake-funnel-0.4.0.pre spec/rake/funnel/tasks/zip_spec.rb