@@ -10,13 +10,13 @@ import (
10func TestCommandBlocking(t *testing.T) {
10func TestCommandBlocking(t *testing.T) {
11 tests := []struct {
11 tests := []struct {
12 name string
12 name string
13− blockFuncs []CommandBlockFunc
13+ blockFuncs []BlockFunc
14 command string
14 command string
15 shouldBlock bool
15 shouldBlock bool
18 name: "block simple command",
18 name: "block simple command",
19− blockFuncs: []CommandBlockFunc{
19+ blockFuncs: []BlockFunc{
20 func(args []string) bool {
20 func(args []string) bool {
21 return len(args) > 0 && args[0] == "curl"
21 return len(args) > 0 && args[0] == "curl"
@@ -26,7 +26,7 @@ func TestCommandBlocking(t *testing.T) {
28 name: "allow non-blocked command",
28 name: "allow non-blocked command",
29− blockFuncs: []CommandBlockFunc{
29+ blockFuncs: []BlockFunc{
30 func(args []string) bool {
30 func(args []string) bool {
31 return len(args) > 0 && args[0] == "curl"
31 return len(args) > 0 && args[0] == "curl"
@@ -36,7 +36,7 @@ func TestCommandBlocking(t *testing.T) {
38 name: "block subcommand",
38 name: "block subcommand",
39− blockFuncs: []CommandBlockFunc{
39+ blockFuncs: []BlockFunc{
40 func(args []string) bool {
40 func(args []string) bool {
41 return len(args) >= 2 && args[0] == "brew" && args[1] == "install"
41 return len(args) >= 2 && args[0] == "brew" && args[1] == "install"
@@ -46,7 +46,7 @@ func TestCommandBlocking(t *testing.T) {
48 name: "allow different subcommand",
48 name: "allow different subcommand",
49− blockFuncs: []CommandBlockFunc{
49+ blockFuncs: []BlockFunc{
50 func(args []string) bool {
50 func(args []string) bool {
51 return len(args) >= 2 && args[0] == "brew" && args[1] == "install"
51 return len(args) >= 2 && args[0] == "brew" && args[1] == "install"
@@ -56,8 +56,8 @@ func TestCommandBlocking(t *testing.T) {
58 name: "block npm global install with -g",
58 name: "block npm global install with -g",
59− blockFuncs: []CommandBlockFunc{
59+ blockFuncs: []BlockFunc{
60− CreateSubCommandBlocker([][]string{
60+ ArgumentsBlocker([][]string{
61 {"npm", "install", "-g"},
61 {"npm", "install", "-g"},
62 {"npm", "install", "--global"},
62 {"npm", "install", "--global"},
@@ -67,8 +67,8 @@ func TestCommandBlocking(t *testing.T) {
69 name: "block npm global install with --global",
69 name: "block npm global install with --global",
70− blockFuncs: []CommandBlockFunc{
70+ blockFuncs: []BlockFunc{
71− CreateSubCommandBlocker([][]string{
71+ ArgumentsBlocker([][]string{
72 {"npm", "install", "-g"},
72 {"npm", "install", "-g"},
73 {"npm", "install", "--global"},
73 {"npm", "install", "--global"},
@@ -78,8 +78,8 @@ func TestCommandBlocking(t *testing.T) {
80 name: "allow npm local install",
80 name: "allow npm local install",
81− blockFuncs: []CommandBlockFunc{
81+ blockFuncs: []BlockFunc{
82− CreateSubCommandBlocker([][]string{
82+ ArgumentsBlocker([][]string{
83 {"npm", "install", "-g"},
83 {"npm", "install", "-g"},
84 {"npm", "install", "--global"},
84 {"npm", "install", "--global"},
@@ -120,4 +120,4 @@ func TestCommandBlocking(t *testing.T) {