<commit_before>package diff_test

import (
	"io/ioutil"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/xchapter7x/enaml/diff"
)

var _ = Describe("jobdiff", func() {

	Describe("given Diff struct ", func() {
		var diff *Diff
		BeforeEach(func() {
			diff = NewDiff("./fixtures")
		})
		XDescribe("given ReleaseDiff method", func() {
			Context("when calling ReleaseDiff with releases that have changed", func() {
				It("then there should be a set of changes", func() {
					diffset, err := diff.ReleaseDiff("url.com/concourse?v=1.0.1", "url.com/concourse?v=1.1.0")
					Ω(err).ShouldNot(HaveOccurred())
					Ω(diffset).ShouldNot(BeEmpty())
				})
			})

			Context("when calling ReleaseDiff with releases that have changed", func() {
				It("then there should not be any changes", func() {
					diffset, err := diff.ReleaseDiff("url.com/concourse?v=1.1.0", "url.com/concourse?v=1.1.0")
					Ω(err).ShouldNot(HaveOccurred())
					Ω(diffset).Should(BeEmpty())
				})
			})
		})
		Describe("given JobDiffBetweenReleases method", func() {
			Context("when calling JobDiffBetweenReleases on 2 releases with unchanged properties", func() {
				It("then it should return an empty changeset", func() {
					diff, err := diff.JobDiffBetweenReleases("atc", "url.com/concourse?v=1.1.0", "url.com/concourse?v=1.1.0")
					Ω(diff).Should(BeEmpty())
					Ω(err).ShouldNot(HaveOccurred())
				})
			})

			Context("when calling JobDiffBetweenReleases on 2 releases with different properties on the given job", func() {
				It("then it should return the diff set", func() {
					diff, err := diff.JobDiffBetweenReleases("atc", "url.com/concourse?v=1.0.1", "url.com/concourse?v=1.1.0")
					Ω(diff).ShouldNot(BeEmpty())
					Ω(err).ShouldNot(HaveOccurred())
				})
			})
		})
	})

	Describe("Given a JobPropertiesDiff func", func() {
		Context("When both yaml sets are the same", func() {
			var jobDiff []string
			BeforeEach(func() {
				var yamlA, _ = ioutil.ReadFile("./fixtures/jobV1.yml")
				jobDiff = JobPropertiesDiff(yamlA, yamlA)
			})

			It("should return no diff records", func() {
				Ω(len(jobDiff)).Should(Equal(0))
			})
		})
		Context("When both yaml sets are different", func() {
			var jobDiff []string
			BeforeEach(func() {
				var yamlA, _ = ioutil.ReadFile("./fixtures/jobV1.yml")
				var yamlB, _ = ioutil.ReadFile("./fixtures/jobV2.yml")
				jobDiff = JobPropertiesDiff(yamlA, yamlB)
			})

			It("should return a list of the differences", func() {
				Ω(len(jobDiff)).Should(BeNumerically(">", 0))
			})
		})
	})
})
<commit_msg>Specify a URI scheme for test releases<commit_after>package diff_test

import (
	"io/ioutil"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/xchapter7x/enaml/diff"
)

var _ = Describe("jobdiff", func() {

	Describe("given Diff struct ", func() {
		var diff *Diff
		BeforeEach(func() {
			diff = NewDiff("./fixtures")
		})
		XDescribe("given ReleaseDiff method", func() {
			Context("when calling ReleaseDiff with releases that have changed", func() {
				It("then there should be a set of changes", func() {
					diffset, err := diff.ReleaseDiff("url.com/concourse?v=1.0.1", "url.com/concourse?v=1.1.0")
					Ω(err).ShouldNot(HaveOccurred())
					Ω(diffset).ShouldNot(BeEmpty())
				})
			})

			Context("when calling ReleaseDiff with releases that have changed", func() {
				It("then there should not be any changes", func() {
					diffset, err := diff.ReleaseDiff("http://url.com/concourse?v=1.1.0", "http://url.com/concourse?v=1.1.0")
					Ω(err).ShouldNot(HaveOccurred())
					Ω(diffset).Should(BeEmpty())
				})
			})
		})
		Describe("given JobDiffBetweenReleases method", func() {
			Context("when calling JobDiffBetweenReleases on 2 releases with unchanged properties", func() {
				It("then it should return an empty changeset", func() {
					diff, err := diff.JobDiffBetweenReleases("atc", "url.com/concourse?v=1.1.0", "url.com/concourse?v=1.1.0")
					Ω(diff).Should(BeEmpty())
					Ω(err).ShouldNot(HaveOccurred())
				})
			})

			Context("when calling JobDiffBetweenReleases on 2 releases with different properties on the given job", func() {
				It("then it should return the diff set", func() {
					diff, err := diff.JobDiffBetweenReleases("atc", "http://url.com/concourse?v=1.0.1", "http://url.com/concourse?v=1.1.0")
					Ω(diff).ShouldNot(BeEmpty())
					Ω(err).ShouldNot(HaveOccurred())
				})
			})
		})
	})

	Describe("Given a JobPropertiesDiff func", func() {
		Context("When both yaml sets are the same", func() {
			var jobDiff []string
			BeforeEach(func() {
				var yamlA, _ = ioutil.ReadFile("./fixtures/jobV1.yml")
				jobDiff = JobPropertiesDiff(yamlA, yamlA)
			})

			It("should return no diff records", func() {
				Ω(len(jobDiff)).Should(Equal(0))
			})
		})
		Context("When both yaml sets are different", func() {
			var jobDiff []string
			BeforeEach(func() {
				var yamlA, _ = ioutil.ReadFile("./fixtures/jobV1.yml")
				var yamlB, _ = ioutil.ReadFile("./fixtures/jobV2.yml")
				jobDiff = JobPropertiesDiff(yamlA, yamlB)
			})

			It("should return a list of the differences", func() {
				Ω(len(jobDiff)).Should(BeNumerically(">", 0))
			})
		})
	})
})

{'fraction_non_alphanumeric': 0.1674705768859734, 'fraction_numerical': 0.012348060968551032, 'mean_word_length': 3.7084468664850134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4291877', 'n_tokens_mistral': 2124, 'n_tokens_neox': 1799, 'n_words': 384}