diff options
Diffstat (limited to 'src/test/java/org/sonar/runner/RunnerTest.java')
-rw-r--r-- | src/test/java/org/sonar/runner/RunnerTest.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/test/java/org/sonar/runner/RunnerTest.java b/src/test/java/org/sonar/runner/RunnerTest.java index 42c3dc9..d7fde1c 100644 --- a/src/test/java/org/sonar/runner/RunnerTest.java +++ b/src/test/java/org/sonar/runner/RunnerTest.java @@ -20,6 +20,12 @@ package org.sonar.runner; +import org.junit.Test; + +import java.io.File; +import java.util.Properties; + +import static org.fest.assertions.Assertions.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; @@ -27,11 +33,6 @@ import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; -import java.io.File; -import java.util.Properties; - -import org.junit.Test; - public class RunnerTest { @Test @@ -95,7 +96,7 @@ public class RunnerTest { Properties properties = new Properties(); Runner runner = Runner.create(properties); assertThat("Default value", runner.isDebug(), is(false)); - properties.setProperty(Runner.VERBOSE, "true"); + properties.setProperty(Runner.PROPERTY_VERBOSE, "true"); assertThat(runner.isDebug(), is(true)); } @@ -126,4 +127,15 @@ public class RunnerTest { assertThat(runner.getProjectDir().exists(), is(true)); } + @Test + public void shouldSpecifyWorkingDirectory() { + Properties properties = new Properties(); + Runner runner = Runner.create(properties); + assertThat(runner.getWorkDir()).isEqualTo(new File(".", ".sonar")); + + properties.setProperty(Runner.PROPERTY_WORK_DIRECTORY, "temp-dir"); + runner = Runner.create(properties); + assertThat(runner.getWorkDir()).isEqualTo(new File(".", "temp-dir")); + } + } |