-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre & Post commands #461
Pre & Post commands #461
Changes from 5 commits
216500e
17a971b
859db19
251e28e
21fde58
f56f994
8d29aa4
02a1cd8
f4f2c22
3761524
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,28 @@ func TestRerunWhenFileChanged(t *testing.T) { | |
} | ||
} | ||
|
||
func TestRunCommand(t *testing.T) { | ||
engine, err := NewEngine("", true) | ||
if err != nil { | ||
t.Fatalf("Should not be fail: %s.", err) | ||
} | ||
err = engine.runCommand("echo Hello Air") | ||
if err != nil { | ||
t.Fatalf("Should not be fail: %s.", err) | ||
} | ||
} | ||
|
||
func TestRunPreCmd(t *testing.T) { | ||
engine, err := NewEngine("", true) | ||
if err != nil { | ||
t.Fatalf("Should not be fail: %s.", err) | ||
} | ||
err = engine.runPreCmd() | ||
xiantang marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should use a real command for integration testing, such as writing a file to the test folder and then checking if the file exists after execution is complete There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the current unit tests can test anything |
||
if err != nil { | ||
t.Fatalf("Should not be fail: %s.", err) | ||
} | ||
} | ||
|
||
func TestRunBin(t *testing.T) { | ||
engine, err := NewEngine("", true) | ||
if err != nil { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate with spaces