Skip to content

Commit

Permalink
Rename yaml to yml.
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krivak committed Sep 9, 2023
1 parent 31fb5b5 commit e9989a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/tmp/
/vendor/
/config.yaml
/config.yml
/connectbox-exporter
16 changes: 8 additions & 8 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func TestReadConfig(t *testing.T) {
t.Run("valid config", func(t *testing.T) {
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yaml")
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yml")
require.NoError(t, err)
defer os.Remove(file.Name())

Expand Down Expand Up @@ -40,7 +40,7 @@ func TestReadConfig(t *testing.T) {
})

t.Run("empty listen address", func(t *testing.T) {
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yaml")
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yml")
require.NoError(t, err)
defer os.Remove(file.Name())

Expand Down Expand Up @@ -70,7 +70,7 @@ func TestReadConfig(t *testing.T) {
})

t.Run("empty target address", func(t *testing.T) {
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yaml")
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yml")
require.NoError(t, err)
defer os.Remove(file.Name())

Expand All @@ -90,7 +90,7 @@ func TestReadConfig(t *testing.T) {
})

t.Run("empty target username", func(t *testing.T) {
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yaml")
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yml")
require.NoError(t, err)
defer os.Remove(file.Name())

Expand Down Expand Up @@ -120,7 +120,7 @@ func TestReadConfig(t *testing.T) {
})

t.Run("empty target password", func(t *testing.T) {
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yaml")
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yml")
require.NoError(t, err)
defer os.Remove(file.Name())

Expand All @@ -139,8 +139,8 @@ func TestReadConfig(t *testing.T) {
require.ErrorContains(t, err, "found target with empty password")
})

t.Run("invalid yaml", func(t *testing.T) {
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yaml")
t.Run("invalid yml", func(t *testing.T) {
file, err := os.CreateTemp(os.TempDir(), "connectbox-exporter.yml")
require.NoError(t, err)
defer os.Remove(file.Name())

Expand All @@ -155,7 +155,7 @@ func TestReadConfig(t *testing.T) {
})

t.Run("non-existing config file", func(t *testing.T) {
_, err := ReadConfig("not-exists.yaml")
_, err := ReadConfig("not-exists.yml")
require.ErrorContains(t, err, "no such file or directory")
})
}

0 comments on commit e9989a6

Please sign in to comment.