avoid creating _scenario.js for test

This commit is contained in:
Jonathan Shook 2020-04-23 14:31:22 -05:00
parent 600b5f6c2d
commit 4a46c17d9a
2 changed files with 6 additions and 6 deletions

View File

@ -114,7 +114,7 @@ public class BasicScriptBuffer implements ScriptBuffer {
public String getParsedScript() {
String scripttext = sb.toString();
if (this.createPath != null) {
if (this.createPath != null && !this.createPath.isEmpty()) {
Path tocreate = Path.of(createPath);
if (Files.exists(tocreate) && !tocreate.getFileName().toString().startsWith("_")) {

View File

@ -12,7 +12,7 @@ public class BasicScriptBufferTest {
public void testScriptInterpolation() {
NBCLIOptions opts = new NBCLIOptions(new String[]{"script", "script_to_interpolate", "parameter1=replaced"});
BasicScriptBuffer b = new BasicScriptBuffer();
BasicScriptBuffer b = new BasicScriptBuffer(null);
b.add(opts.getCommands().toArray(new Cmd[0]));
String s = b.getParsedScript();
@ -23,7 +23,7 @@ public class BasicScriptBufferTest {
@Test
public void testAutoScriptCommand() {
NBCLIOptions opts = new NBCLIOptions(new String[]{ "acommand" });
BasicScriptBuffer b = new BasicScriptBuffer();
BasicScriptBuffer b = new BasicScriptBuffer(null);
b.add(opts.getCommands().toArray(new Cmd[0]));
String s = b.getParsedScript();
@ -37,7 +37,7 @@ public class BasicScriptBufferTest {
"testscripts/printscript.js",
"param1=value1"
});
BasicScriptBuffer b = new BasicScriptBuffer();
BasicScriptBuffer b = new BasicScriptBuffer(null);
b.add(opts.getCommands().toArray(new Cmd[0]));
String script = b.getParsedScript();
@ -55,7 +55,7 @@ public class BasicScriptBufferTest {
"paramname=another",
"param2=andanother"
});
BasicScriptBuffer b = new BasicScriptBuffer();
BasicScriptBuffer b = new BasicScriptBuffer(null);
b.add(opts.getCommands().toArray(new Cmd[0]));
String script = b.getParsedScript();
@ -65,7 +65,7 @@ public class BasicScriptBufferTest {
@Test(expected = NumberFormatException.class)
public void shouldThrowErrorForInvalidWaitMillisOperand() {
NBCLIOptions opts = new NBCLIOptions(new String[]{ "waitmillis", "noway" });
BasicScriptBuffer b = new BasicScriptBuffer();
BasicScriptBuffer b = new BasicScriptBuffer(null);
b.add(opts.getCommands().toArray(new Cmd[0]));
String s = b.getParsedScript();
}