aboutsummaryrefslogtreecommitdiff
path: root/pkg/hooks/hooks_test.go
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2018-05-30 14:02:20 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-31 14:11:52 +0000
commit4dfe0d60f3593360b9d43d8dd38981e971c9b642 (patch)
treeb8e2f70c9df7b8bb5613b16df296b26daf417fe8 /pkg/hooks/hooks_test.go
parent7c1434c2f7fd4e8922f3feb1e5babe2b9804cce9 (diff)
downloadpodman-4dfe0d60f3593360b9d43d8dd38981e971c9b642.tar.gz
podman-4dfe0d60f3593360b9d43d8dd38981e971c9b642.tar.bz2
podman-4dfe0d60f3593360b9d43d8dd38981e971c9b642.zip
hooks: Rename Hooks() output to extensionStageHooks
To more clearly distinguish between the extensionStages input to New() (a slice of strings) and the map output from Hooks(). Signed-off-by: W. Trevor King <wking@tremily.us> Closes: #855 Approved by: rhatdan
Diffstat (limited to 'pkg/hooks/hooks_test.go')
-rw-r--r--pkg/hooks/hooks_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/pkg/hooks/hooks_test.go b/pkg/hooks/hooks_test.go
index 8bd89f56f..b93a1d54d 100644
--- a/pkg/hooks/hooks_test.go
+++ b/pkg/hooks/hooks_test.go
@@ -54,7 +54,7 @@ func TestGoodNew(t *testing.T) {
}
config := &rspec.Spec{}
- extensionStages, err := manager.Hooks(config, map[string]string{}, false)
+ extensionStageHooks, err := manager.Hooks(config, map[string]string{}, false)
if err != nil {
t.Fatal(err)
}
@@ -91,8 +91,8 @@ func TestGoodNew(t *testing.T) {
},
}, config.Hooks)
- var nilExtensionStages map[string][]rspec.Hook
- assert.Equal(t, nilExtensionStages, extensionStages)
+ var nilExtensionStageHooks map[string][]rspec.Hook
+ assert.Equal(t, nilExtensionStageHooks, extensionStageHooks)
}
func TestBadNew(t *testing.T) {
@@ -142,14 +142,14 @@ func TestBrokenMatch(t *testing.T) {
Args: []string{"/bin/sh"},
},
}
- extensionStages, err := manager.Hooks(config, map[string]string{}, false)
+ extensionStageHooks, err := manager.Hooks(config, map[string]string{}, false)
if err == nil {
t.Fatal("unexpected success")
}
assert.Regexp(t, "^matching hook \"a\\.json\": command: error parsing regexp: .*", err.Error())
- var nilExtensionStages map[string][]rspec.Hook
- assert.Equal(t, nilExtensionStages, extensionStages)
+ var nilExtensionStageHooks map[string][]rspec.Hook
+ assert.Equal(t, nilExtensionStageHooks, extensionStageHooks)
}
func TestInvalidStage(t *testing.T) {
@@ -168,14 +168,14 @@ func TestInvalidStage(t *testing.T) {
},
},
}
- extensionStages, err := manager.Hooks(&rspec.Spec{}, map[string]string{}, false)
+ extensionStageHooks, err := manager.Hooks(&rspec.Spec{}, map[string]string{}, false)
if err == nil {
t.Fatal("unexpected success")
}
assert.Regexp(t, "^hook \"a\\.json\": unknown stage \"does-not-exist\"$", err.Error())
- var nilExtensionStages map[string][]rspec.Hook
- assert.Equal(t, nilExtensionStages, extensionStages)
+ var nilExtensionStageHooks map[string][]rspec.Hook
+ assert.Equal(t, nilExtensionStageHooks, extensionStageHooks)
}
func TestExtensionStage(t *testing.T) {
@@ -197,7 +197,7 @@ func TestExtensionStage(t *testing.T) {
}
config := &rspec.Spec{}
- extensionStages, err := manager.Hooks(config, map[string]string{}, false)
+ extensionStageHooks, err := manager.Hooks(config, map[string]string{}, false)
if err != nil {
t.Fatal(err)
}
@@ -226,7 +226,7 @@ func TestExtensionStage(t *testing.T) {
Path: "/a/b/c",
},
},
- }, extensionStages)
+ }, extensionStageHooks)
}
func init() {