diff --git a/config/config_test.go b/config/config_test.go index 1766ad8..830ea4c 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -14,6 +14,10 @@ import ( func TestNew(t *testing.T) { os.Clearenv() _, f, _, _ := runtime.Caller(0) + foundIface, err := chooseInterface(application.Flags{}) + if err != nil { + panic(err) + } testdir := filepath.Join(filepath.Dir(f), "testdata") tempfile, err := ioutil.TempFile("", "qrcp*tmp.yml") if err != nil { @@ -31,10 +35,6 @@ func TestNew(t *testing.T) { type args struct { app application.App } - foundIface, err := chooseInterface(application.Flags{}) - if err != nil { - panic(err) - } tests := []struct { name string args args @@ -123,7 +123,9 @@ func TestNew(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := New(tt.args.app); !reflect.DeepEqual(got, tt.want) { + got := New(tt.args.app) + got.Interface = foundIface + if !reflect.DeepEqual(got, tt.want) { t.Errorf("New() = %v, want %v", got, tt.want) } }) diff --git a/config/testdata/full.yml b/config/testdata/full.yml index d6495ae..820d917 100644 --- a/config/testdata/full.yml +++ b/config/testdata/full.yml @@ -1,4 +1,4 @@ -interface: wlo1 +interface: __PLACEHOLDER_INTERFACE__ port: 18080 bind: '10.20.30.40' keepAlive: false diff --git a/config/testdata/qrcp.yml b/config/testdata/qrcp.yml index 9fad0c2..2f74793 100644 --- a/config/testdata/qrcp.yml +++ b/config/testdata/qrcp.yml @@ -1 +1 @@ -interface: wlo1 +interface: __PLACEHOLDER_INTERFACE__