spec/environment_spec.rb in palimpsest-0.1.0 vs spec/environment_spec.rb in palimpsest-0.1.1
- old
+ new
@@ -77,13 +77,15 @@
end
end
end
describe "#copy" do
- it "moves the component to the install path" do
+
+ it "copies the environment to the destination" do
dir = environment.directory
allow(Dir).to receive(:[]).with("#{dir}/*").and_return( %W(#{dir}/path/1 #{dir}/path/2) )
+ expect(FileUtils).to receive(:mkdir_p).with('/dest/path')
expect(FileUtils).to receive(:cp_r).with( %W(#{dir}/path/1 #{dir}/path/2), '/dest/path', preserve: true)
environment.copy dest: '/dest/path'
end
end
@@ -290,16 +292,14 @@
allow(environment).to receive(:externals).and_return( [ external_1, external_2 ] )
allow(external_1).to receive(:install)
allow(external_2).to receive(:install)
end
- it "installs the externals" do
- expect(external_1).to receive(:install)
- expect(external_2).to receive(:install)
- environment.install_externals
- end
-
- it "returns itself" do
+ it "installs the externals and returns itself" do
+ expect(external_1).to receive(:install).and_return(external_1)
+ expect(external_1).to receive(:cleanup)
+ expect(external_2).to receive(:install).and_return(external_2)
+ expect(external_2).to receive(:cleanup)
expect(environment.install_externals).to be environment
end
end
describe "#assets" do