Ejemplo n.º 1
0
        public void Head_PullRequestNumberSet_HasCorrectValue()
        {
            Environment.SetEnvironmentVariable("GIT_BRANCH", "origin/pr/1234");

            var git = new JenkinsGit(fileSystem);

            git.Head.PullRequestId.Should().Be("1234");
        }
Ejemplo n.º 2
0
        public void Branch_EnvVariableSet_ParsesBranchFromRemote()
        {
            Environment.SetEnvironmentVariable("GIT_BRANCH", "origin/master");

            var git = new JenkinsGit(fileSystem);

            git.CurrentBranch.Should().Be("master");
        }
Ejemplo n.º 3
0
        public void Branch_EnvVariableSet_AssumesMasterOnPullRequest()
        {
            Environment.SetEnvironmentVariable("GIT_BRANCH", "origin/pr/1234/merge");

            var git = new JenkinsGit(fileSystem);

            git.CurrentBranch.Should().Be("master");
        }
Ejemplo n.º 4
0
        public void Branch_EnvVariableSet_PullsValue()
        {
            Environment.SetEnvironmentVariable("GIT_BRANCH", "master");

            var git = new JenkinsGit(fileSystem);

            git.CurrentBranch.Should().Be("master");
        }