Ejemplo n.º 1
0
            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}");
            }
Ejemplo n.º 2
0
        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>();
        }
Ejemplo n.º 3
0
        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");
        }
Ejemplo n.º 4
0
            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");
            }
Ejemplo n.º 5
0
            public void Should_Run_With_Defaults()
            {
                var fixture = new VagrantFixture(r => r.Box.Outdated());
                var result  = fixture.Run();

                result.Args.Should().Be("box outdated");
            }
Ejemplo n.º 6
0
            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");
            }
Ejemplo n.º 7
0
            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}\"");
            }
Ejemplo n.º 8
0
            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}");
            }
Ejemplo n.º 9
0
            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()}");
            }
Ejemplo n.º 10
0
            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");
            }
Ejemplo n.º 11
0
            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>();
            }
Ejemplo n.º 12
0
            public void Should_Pop_Without_Name()
            {
                var fixture = new VagrantFixture(r => r.Snapshot.Pop());
                var result  = fixture.Run();

                result.Args.Should().Be("snapshot pop");
            }
Ejemplo n.º 13
0
            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");
            }
Ejemplo n.º 14
0
            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");
            }
Ejemplo n.º 15
0
            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");
            }
Ejemplo n.º 16
0
            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");
            }
Ejemplo n.º 17
0
            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");
            }
Ejemplo n.º 18
0
            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");
            }
Ejemplo n.º 19
0
            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}\"");
            }
Ejemplo n.º 20
0
            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"));
            }
Ejemplo n.º 21
0
            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}");
            }
Ejemplo n.º 22
0
            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>();
            }
Ejemplo n.º 23
0
            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");
            }
Ejemplo n.º 24
0
            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>();
            }
Ejemplo n.º 25
0
            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");
            }
Ejemplo n.º 26
0
            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>();
            }
Ejemplo n.º 27
0
        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>();
        }
Ejemplo n.º 28
0
            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");
            }
Ejemplo n.º 29
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");
        }
Ejemplo n.º 30
0
            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>();
            }