<commit_before>package main

import (
	"testing"
	. "github.com/onsi/gomega"
	"github.com/mitchellh/go-homedir"
)


func Test_getHoverflyDirectory(t *testing.T) {
	RegisterTestingT(t)

	result := getHoverflyDirectory("/test/dir/.hoverfly/config.yaml")

	Expect(result).To(Equal("/test/dir/.hoverfly"))
}

func Test_getHoverflyDirectory_ReturnsHomeDirIfConfigUriIsEmpty(t *testing.T) {
	RegisterTestingT(t)

	result := getHoverflyDirectory("")

	homeDir, _ := homedir.Dir()

	Expect(result).To(Equal(homeDir + "/.hoverfly"))
}<commit_msg>Starting to add tests around config<commit_after>package main

import (
	"testing"
	. "github.com/onsi/gomega"
)


func Test_GetConfigWillReturnTheDefaultValues(t *testing.T) {
	RegisterTestingT(t)

	SetConfigurationDefaults()
	result := GetConfig("", "", "")

	Expect(result.HoverflyHost).To(Equal("localhost"))
	Expect(result.HoverflyAdminPort).To(Equal("8888"))
	Expect(result.HoverflyProxyPort).To(Equal("8500"))
	Expect(result.SpectoLabHost).To(Equal("localhost"))
	Expect(result.SpectoLabPort).To(Equal("81"))
	Expect(result.SpectoLabApiKey).To(Equal(""))
}

func Test_GetConfigOverridesDefaultValueWithAHoverflyHost(t *testing.T) {
	RegisterTestingT(t)

	SetConfigurationDefaults()
	hoverflyHost := "testhost"
	result := GetConfig(hoverflyHost, "", "")


	Expect(result.HoverflyHost).To(Equal(hoverflyHost))
	Expect(result.HoverflyAdminPort).To(Equal("8888"))
	Expect(result.HoverflyProxyPort).To(Equal("8500"))
	Expect(result.SpectoLabHost).To(Equal("localhost"))
	Expect(result.SpectoLabPort).To(Equal("81"))
	Expect(result.SpectoLabApiKey).To(Equal(""))
}

func Test_GetConfigOverridesDefaultValueWithAHoverflyAdminPort(t *testing.T) {
	RegisterTestingT(t)

	SetConfigurationDefaults()
	hoverflyAdminPort := "5"
	result := GetConfig("", hoverflyAdminPort, "")

	Expect(result.HoverflyHost).To(Equal("localhost"))
	Expect(result.HoverflyAdminPort).To(Equal(hoverflyAdminPort))
	Expect(result.HoverflyProxyPort).To(Equal("8500"))
	Expect(result.SpectoLabHost).To(Equal("localhost"))
	Expect(result.SpectoLabPort).To(Equal("81"))
	Expect(result.SpectoLabApiKey).To(Equal(""))
}

func Test_GetConfigOverridesDefaultValueWithAHoverflyProxyPort(t *testing.T) {
	RegisterTestingT(t)

	SetConfigurationDefaults()
	hoverflyProxyPort := "7"
	result := GetConfig("", "", hoverflyProxyPort)

	Expect(result.HoverflyHost).To(Equal("localhost"))
	Expect(result.HoverflyAdminPort).To(Equal("8888"))
	Expect(result.HoverflyProxyPort).To(Equal(hoverflyProxyPort))
	Expect(result.SpectoLabHost).To(Equal("localhost"))
	Expect(result.SpectoLabPort).To(Equal("81"))
	Expect(result.SpectoLabApiKey).To(Equal(""))
}

func Test_GetConfigOverridesDefaultValueWithAllOverrides(t *testing.T) {
	RegisterTestingT(t)

	SetConfigurationDefaults()
	hoverflyHost := "specto.io"
	hoverflyAdminPort := "7654"
	hoverflyProxyPort := "1523"
	result := GetConfig(hoverflyHost, hoverflyAdminPort, hoverflyProxyPort)

	Expect(result.HoverflyHost).To(Equal(hoverflyHost))
	Expect(result.HoverflyAdminPort).To(Equal(hoverflyAdminPort))
	Expect(result.HoverflyProxyPort).To(Equal(hoverflyProxyPort))
	Expect(result.SpectoLabHost).To(Equal("localhost"))
	Expect(result.SpectoLabPort).To(Equal("81"))
	Expect(result.SpectoLabApiKey).To(Equal(""))
}
{'fraction_non_alphanumeric': 0.15625961242694555, 'fraction_numerical': 0.01353429713934174, 'mean_word_length': 8.564705882352941, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5724879', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1116, 'n_words': 114}