skynet-deploy 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/skynet/builder/base.rb
CHANGED
@@ -8,6 +8,9 @@ module Skynet
|
|
8
8
|
Skynet.logger.info "Static running for #{app}..."
|
9
9
|
super
|
10
10
|
|
11
|
+
Skynet.logger.debug "Removing #{destination}/*"
|
12
|
+
FileUtils.rm_rf Dir.glob(File.join destination, '*'), secure: true
|
13
|
+
|
11
14
|
Skynet.logger.debug "Copying #{source} to #{destination}"
|
12
15
|
FileUtils.cp_r source, destination
|
13
16
|
|
data/lib/skynet/version.rb
CHANGED
@@ -20,14 +20,9 @@ describe Skynet::Builder::Base do
|
|
20
20
|
|
21
21
|
describe "#build" do
|
22
22
|
context "when valid" do
|
23
|
-
|
24
|
-
|
25
|
-
subject.stub :build_repository
|
26
|
-
FileUtils.should_receive(:rm_rf).with [:one, :two], secure: true
|
27
|
-
subject.build
|
28
|
-
end
|
23
|
+
before(:each) { subject.stub :build_repository }
|
24
|
+
it { expect { subject.build }.to_not raise_error }
|
29
25
|
end
|
30
|
-
|
31
26
|
context "when invalid" do
|
32
27
|
let(:options) { {} }
|
33
28
|
it { expect { subject.build }.to raise_error ArgumentError }
|
@@ -12,7 +12,14 @@ describe Skynet::Builder::Static do
|
|
12
12
|
before(:each) do
|
13
13
|
subject.should_receive :build_repository
|
14
14
|
subject.stub(:valid?).and_return true
|
15
|
-
|
15
|
+
Dir.stub(:glob).and_return [:one, :two]
|
16
|
+
end
|
17
|
+
|
18
|
+
it "removes destination files first" do
|
19
|
+
FileUtils.stub :remove_entry_secure
|
20
|
+
FileUtils.stub :cp_r
|
21
|
+
FileUtils.should_receive(:rm_rf).with [:one, :two], secure: true
|
22
|
+
subject.build
|
16
23
|
end
|
17
24
|
|
18
25
|
it "copies files to the destination" do
|