spec/container_spec.rb in testlab-0.7.4 vs spec/container_spec.rb in testlab-0.7.5
- old
+ new
@@ -21,11 +21,11 @@
describe TestLab::Container do
subject {
@ui = ZTK::UI.new(:stdout => StringIO.new, :stderr => StringIO.new)
- @testlab = TestLab.new(:labfile => LABFILE, :ui => @ui)
+ @testlab = TestLab.new(:labfile_path => LABFILE, :ui => @ui)
@testlab.containers.first
}
describe "class" do
@@ -143,10 +143,11 @@
end
end
describe "#create" do
it "should create the container" do
+ subject.node.stub(:state) { :running }
subject.lxc.config.stub(:save) { true }
subject.stub(:detect_arch) { "amd64" }
subject.lxc.stub(:create) { true }
subject.lxc.stub(:state) { :not_created }
subject.node.ssh.stub(:exec)
@@ -154,20 +155,22 @@
end
end
describe "#destroy" do
it "should destroy the container" do
+ subject.node.stub(:state) { :running }
subject.lxc.stub(:exists?) { true }
subject.lxc.stub(:state) { :stopped }
subject.lxc.stub(:destroy) { true }
subject.lxc_clone.stub(:destroy) { true }
subject.destroy
end
end
describe "#up" do
it "should up the container" do
+ subject.node.stub(:state) { :running }
subject.lxc.stub(:exists?) { true }
subject.lxc.stub(:start) { true }
subject.lxc.stub(:wait) { true }
subject.lxc.stub(:state) { :running }
subject.lxc.stub(:attach)
@@ -178,9 +181,10 @@
end
end
describe "#down" do
it "should down the container" do
+ subject.node.stub(:state) { :running }
subject.lxc.stub(:exists?) { true }
subject.lxc.stub(:stop) { true }
subject.lxc.stub(:wait) { true }
subject.lxc.stub(:state) { :stopped }
subject.down