Inheritance: ISpecFileListener
Beispiel #1
0
        public override bool Execute(JasmineInput input)
        {
            if (input.Mode == JasmineMode.add_folders)
            {
                new FileSystem().AlterFlatFile(input.SerenityFile, list =>
                {
                    var includes = input.Folders.Select(folder => "include:" + folder);
                    list.Fill(includes);
                });

                return(true);
            }

            // TODO -- tighten up the defensive programming against bad input
            var runner = new JasmineRunner(input);

            if (input.Mode == JasmineMode.interactive)
            {
                runner.OpenInteractive();
            }

            if (input.Mode == JasmineMode.run)
            {
                if (!runner.RunAllSpecs())
                {
                    throw new ApplicationException("Jasmine specs failed!");
                }
            }



            return(true);
        }
 public void runs_the_specs()
 {
     var runner = new JasmineRunner(theInput);
     runner.RunAllSpecs().ShouldBeTrue();
 }