diff options
Diffstat (limited to 'service/headers/config_test.go')
-rw-r--r-- | service/headers/config_test.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/service/headers/config_test.go b/service/headers/config_test.go deleted file mode 100644 index 6ea02f67..00000000 --- a/service/headers/config_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package headers - -import ( - json "github.com/json-iterator/go" - "github.com/spiral/roadrunner/service" - "github.com/stretchr/testify/assert" - "testing" -) - -type mockCfg struct{ cfg string } - -func (cfg *mockCfg) Get(name string) service.Config { return nil } -func (cfg *mockCfg) Unmarshal(out interface{}) error { - j := json.ConfigCompatibleWithStandardLibrary - return j.Unmarshal([]byte(cfg.cfg), out) -} - -func Test_Config_Hydrate_Error1(t *testing.T) { - cfg := &mockCfg{`{"request": {"From": "Something"}}`} - c := &Config{} - - assert.NoError(t, c.Hydrate(cfg)) -} - -func Test_Config_Hydrate_Error2(t *testing.T) { - cfg := &mockCfg{`{"dir": "/dir/"`} - c := &Config{} - - assert.Error(t, c.Hydrate(cfg)) -} |