<commit_before>using System.Diagnostics;
using System.IO;
using System.Reflection;
using NUnit.Framework;
using System;
using NSpec;
using SampleSpecs.Bug;

namespace NSpecSpecs
{
    [TestFixture]
    public class describe_output 
    {
        [Test,
        TestCase(typeof(my_first_spec_output)),
        TestCase(typeof(describe_specifications_output)),
        TestCase(typeof(describe_before_output)),
        TestCase(typeof(describe_contexts_output)),
        TestCase(typeof(describe_pending_output)),
        TestCase(typeof(describe_helpers_output)),
        TestCase(typeof(describe_batman_sound_effects_as_text_output)),
        TestCase(typeof(describe_class_level_output)),
        TestCase(typeof(given_the_sequence_continues_with_2_output)),
        TestCase(typeof(describe_exception_output)),
        TestCase(typeof(describe_context_stack_trace_output)),
        TestCase(typeof(describe_ICollection_output))]
        public void output_verification(Type output)
        {
            var expectedOutput = output.GetField("Output").GetValue(output);

            var tag = output.Name.Replace("_output", "");

            Run(tag).Is(expectedOutput);
        }

        public string Run(string tag)
        {
            var process = new Process();

            var currentPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase.Replace("file:///", "").Replace("/", @"\"));

            var testDllPath = @"""" + currentPath + @"\..\..\..\SampleSpecs\bin\Debug\SampleSpecs.dll""";

            var exePath = @"""" +  currentPath + @"\..\..\..\NSpecRunner\bin\Debug\NSpecRunner.exe""";

            process.StartInfo = new ProcessStartInfo
                                    {
                                        FileName = exePath,
                                        Arguments = testDllPath + " --tag " + tag,
                                        RedirectStandardInput = true,
                                        RedirectStandardError = true,
                                        RedirectStandardOutput = true,
                                        WindowStyle = ProcessWindowStyle.Hidden,
                                        UseShellExecute = false,
                                        CreateNoWindow = true
                                    };

            process.Start();

            process.WaitForExit();

            var output = process.StandardOutput.ReadToEnd();

            return output.RegexReplace("in .*SampleSpecs", "in SampleSpecs");
        }

        [Test]
        public void describe_regex_replace()
        {
            "in c:\\SampleSpecs".RegexReplace("in .*SampleSpecs","in SampleSpecs").Is("in SampleSpecs");<commit_msg>I need this to make output specs pass<commit_after>using System.Diagnostics;
using System.IO;
using System.Reflection;
using NUnit.Framework;
using System;
using NSpec;
using SampleSpecs.Bug;

namespace NSpecSpecs
{
    [TestFixture]
    public class describe_output 
    {
        [Test,
        TestCase(typeof(my_first_spec_output)),
        TestCase(typeof(describe_specifications_output)),
        TestCase(typeof(describe_before_output)),
        TestCase(typeof(describe_contexts_output)),
        TestCase(typeof(describe_pending_output)),
        TestCase(typeof(describe_helpers_output)),
        TestCase(typeof(describe_batman_sound_effects_as_text_output)),
        TestCase(typeof(describe_class_level_output)),
        TestCase(typeof(given_the_sequence_continues_with_2_output)),
        TestCase(typeof(describe_exception_output)),
        TestCase(typeof(describe_context_stack_trace_output)),
        TestCase(typeof(describe_ICollection_output))]
        public void output_verification(Type output)
        {
            var expectedOutput = output.GetField("Output").GetValue(output);

            var tag = output.Name.Replace("_output", "");

            Run(tag).Is(expectedOutput);
        }

        public string Run(string tag)
        {
            var process = new Process();

            var currentPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase.Replace("file:///", "").Replace("/", @"\"));

            var testDllPath = @"""" + currentPath + @"\..\..\..\SampleSpecs\bin\Debug\SampleSpecs.dll""";

            var exePath = @"""" +  currentPath + @"\..\..\..\NSpecRunner\bin\Debug\NSpecRunner.exe""";

            process.StartInfo = new ProcessStartInfo
                                    {
                                        FileName = exePath,
                                        Arguments = testDllPath + " --tag " + tag,
                                        RedirectStandardInput = true,
                                        RedirectStandardError = true,
                                        RedirectStandardOutput = true,
                                        WindowStyle = ProcessWindowStyle.Hidden,
                                        UseShellExecute = false,
                                        CreateNoWindow = true
                                    };

            process.Start();

            process.WaitForExit();

            var output = process.StandardOutput.ReadToEnd();

            return output.RegexReplace("in .*SampleSpecs", "in SampleSpecs").Replace("\r\n","\n");
        }

        [Test]
        public void describe_regex_replace()
        {
            "in c:\\SampleSpecs".RegexReplace("in .*SampleSpecs","in SampleSpecs").Is("in SampleSpecs");
{'fraction_non_alphanumeric': 0.107032527712157, 'fraction_numerical': 0.00036343812465927677, 'mean_word_length': 1.8636836628511966, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '749337', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1296, 'n_words': 214}