spec/rake/funnel/tasks/zip_spec.rb in rake-funnel-0.21.0 vs spec/rake/funnel/tasks/zip_spec.rb in rake-funnel-0.21.1
- old
+ new
@@ -1,11 +1,8 @@
-include Rake
-include Rake::Funnel::Support
-
describe Rake::Funnel::Tasks::Zip do
before do
- Task.clear
+ Rake::Task.clear
end
describe 'defaults' do
its(:name) { should == :package }
its(:source) { should eq([]) }
@@ -14,19 +11,19 @@
its(:allow_empty) { should eq(true) }
end
describe 'execution' do
let(:source) { %w(bin/1 bin/2 bin/3/4) }
- let(:finder) { instance_double(Finder).as_null_object }
+ let(:finder) { instance_double(Rake::Funnel::Support::Finder).as_null_object }
before do
allow(finder).to receive(:all_or_default).and_return(source)
- allow(Finder).to receive(:new).and_return(finder)
+ allow(Rake::Funnel::Support::Finder).to receive(:new).and_return(finder)
end
before do
- allow(Zipper).to receive(:zip)
+ allow(Rake::Funnel::Support::Zipper).to receive(:zip)
allow(Rake).to receive(:rake_output_message)
end
subject do
described_class.new do |t|
@@ -35,15 +32,16 @@
t.zip_root = 'zip root'
end
end
before do
- Task[subject.name].invoke
+ Rake::Task[subject.name].invoke
end
it 'should delegate to Zipper' do
- expect(Zipper).to have_received(:zip).with(subject.source, subject.target, subject.zip_root)
+ expect(Rake::Funnel::Support::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
@@ -61,27 +59,27 @@
context 'empty allowed with empty file list' do
let(:source) { [] }
let(:allow_empty) { true }
before do
- Task[subject.name].invoke
+ Rake::Task[subject.name].invoke
end
it 'should invoker Zipper' do
- expect(Zipper).to have_received(:zip)
+ expect(Rake::Funnel::Support::Zipper).to have_received(:zip)
end
end
context 'empty not allowed with empty file list' do
let(:source) { [] }
let(:allow_empty) { false }
before do
- Task[subject.name].invoke
+ Rake::Task[subject.name].invoke
end
it 'should not invoker Zipper' do
- expect(Zipper).not_to have_received(:zip)
+ expect(Rake::Funnel::Support::Zipper).not_to have_received(:zip)
end
it 'should warn' do
expect(Rake).to have_received(:rake_output_message).with('No files to zip')
end