public void Should_Add_Provisioners_When_Set(bool run, string flagValue) { var fixture = new VagrantFixture(r => r.Snapshot.Restore("ss2", s => s.RunProvisioners(run))); var result = fixture.Run(); result.Args.Should().Be($"snapshot restore ss2 {flagValue}"); }
public void Should_Throw_On_Null_Command(string command) { var fixture = new VagrantFixture(r => r.Docker.Exec("web", command)); var action = new Action(() => fixture.Run()); action.ShouldThrow <ArgumentNullException>(); }
public void Should_Exec_Command_Name() { var fixture = new VagrantFixture(r => r.Docker.Exec("web", "cowsay")); var result = fixture.Run(); result.Args.Should().Be("docker-exec web -- cowsay"); }
public void Should_Set_Clean_Flag() { var fixture = new VagrantFixture(r => r.Box.Add("hashicorp/precise64", s => s.CleanFirst())); var result = fixture.Run(); result.Args.Should().Be($"box add {"hashicorp/precise64".Quote()} --clean"); }
public void Should_Run_With_Defaults() { var fixture = new VagrantFixture(r => r.Box.Outdated()); var result = fixture.Run(); result.Args.Should().Be("box outdated"); }
public void Should_Specify_Provider_When_Box_Name_Is_Set() { var fixture = new VagrantFixture(r => r.Box.Update(s => s.OnlyUpdate("natty").UseProvider("docker"))); var result = fixture.Run(); result.Args.Should().Be("box update --box natty --provider docker"); }
public void Should_Set_Version_Constraint(string version) { var fixture = new VagrantFixture(r => r.Box.Add("hashicorp/precise64", s => s.ConstrainVersion(version))); var result = fixture.Run(); result.Args.Should().Be($"box add {"hashicorp/precise64".Quote()} --version \"{version}\""); }
public void Should_Include_Provider_When_Set(string provider) { var fixture = new VagrantFixture(r => r.Box.Remove("utopic", s => s.UseProvider(provider))); var result = fixture.Run(); result.Args.Should().Be($"box remove utopic --provider {provider}"); }
public void Should_Set_Version_Constraint(string version) { var fixture = new VagrantFixture(r => r.Box.Remove("vivid", s => s.ConstrainVersion(version))); var result = fixture.Run(); result.Args.Should().Be($"box remove vivid --box-version {version.Quote()}"); }
public void Should_Restore_With_Name() { var fixture = new VagrantFixture(r => r.Snapshot.Restore("snapshot2")); var result = fixture.Run(); result.Args.Should().Be("snapshot restore snapshot2"); }
public void Should_Throw_When_No_Name_Set(string name) { var fixture = new VagrantFixture(r => r.Box.Remove(name)); Action action = () => fixture.Run(); action.ShouldThrow <ArgumentNullException>(); }
public void Should_Pop_Without_Name() { var fixture = new VagrantFixture(r => r.Snapshot.Pop()); var result = fixture.Run(); result.Args.Should().Be("snapshot pop"); }
public void Should_Not_Add_NoDelete_For_Restore() { var fixture = new VagrantFixture(r => r.Snapshot.Restore("snapshot2", s => s.DoNotDelete())); var result = fixture.Run(); result.Args.Should().Be("snapshot restore snapshot2"); }
public void Should_Add_NoDelete_For_Pop() { var fixture = new VagrantFixture(r => r.Snapshot.Pop(s => s.DoNotDelete())); var result = fixture.Run(); result.Args.Should().Be("snapshot pop --no-delete"); }
public void Should_Not_Specify_Provider_When_Box_Name_Not_Set() { var fixture = new VagrantFixture(r => r.Box.Update(s => s.UseProvider("docker"))); var result = fixture.Run(); result.Args.Should().Be("box update"); }
public void Should_Delete_All_When_Set() { var fixture = new VagrantFixture(r => r.Box.Remove("precise", s => s.RemoveAll())); var result = fixture.Run(); result.Args.Should().Be("box remove precise --all"); }
public void Should_Specify_Name_When_Set() { var fixture = new VagrantFixture(r => r.Box.Update(s => s.OnlyUpdate("oneiric"))); var result = fixture.Run(); result.Args.Should().Be("box update --box oneiric"); }
public void Should_Include_Force_When_Set() { var fixture = new VagrantFixture(r => r.Box.Remove("trusty", s => s.Force())); var result = fixture.Run(); result.Args.Should().Be("box remove trusty --force"); }
public void Should_Run_With_Defaults(string address) { var fixture = new VagrantFixture(r => r.Box.Add(address)); var result = fixture.Run(); result.Args.Should().Be($"box add \"{address}\""); }
public void Should_Throw_On_Null_Address(string address) { var fixture = new VagrantFixture(r => r.Box.Add(address)); var action = new Action(() => fixture.Run()); action.ShouldThrow <ArgumentNullException>().Where(e => e.Message.Contains("address")); }
public void Should_Use_Chosen_Provider(string provider) { var fixture = new VagrantFixture(r => r.Box.Add("hashicorp/precise64", s => s.UseProvider(provider))); var result = fixture.Run(); result.Args.Should().Be($"box add \"hashicorp/precise64\" --provider {provider}"); }
public void Should_Throw_With_Blank_Name(string name) { var fixture = new VagrantFixture(r => r.Box.Repackage(name, "docker", "1.0.0")); Action action = () => fixture.Run(); action.ShouldThrow <ArgumentNullException>(); }
public void Should_Set_Insecure_Flag() { var fixture = new VagrantFixture(r => r.Box.Add("hashicorp/precise64", s => s.AllowInsecure())); var result = fixture.Run(); result.Args.Should().Be("box add \"hashicorp/precise64\" --insecure"); }
public void Should_Throw_When_No_Provider_Given(string provider) { var fixture = new VagrantFixture(r => r.Box.Repackage("vagrant", provider, "1.0.0")); Action action = () => fixture.Run(); action.ShouldThrow <ArgumentNullException>(); }
public void Should_Specify_Global_When_Set() { var fixture = new VagrantFixture(r => r.Box.Outdated(true)); var result = fixture.Run(); result.Args.Should().Be("box outdated --global"); }
public void Should_Throw_Without_Version(string version) { var fixture = new VagrantFixture(r => r.Box.Repackage("vagrant", "docker", version)); Action action = () => fixture.Run(); action.ShouldThrow <ArgumentNullException>(); }
public void Should_Throw_On_Null_Name(string name) { var fixture = new VagrantFixture(r => r.Docker.Exec(name, "echo")); var action = new Action(() => fixture.Run()); action.ShouldThrow <ArgumentNullException>(); }
public void Should_Include_Options() { var fixture = new VagrantFixture(r => r.Box.Repackage("hashicorp", "docker", "1.0.0")); var result = fixture.Run(); result.Args.Should().Be("box repackage hashicorp docker 1.0.0"); }
public void Should_Run_Command_Name() { var fixture = new VagrantFixture(r => r.Docker.Run("db", "fortune")); var result = fixture.Run(); result.Args.Should().Be("docker-run db -- fortune"); }
public void Should_Not_Restore_Without_Name(string name) { var fixture = new VagrantFixture(r => r.Snapshot.Restore(name)); Action action = () => fixture.Run(); action.ShouldThrow <ArgumentNullException>(); }