Skip to content

Commit d0784c4

Browse files
committed
Merge pull request exercism#78 from sit/unify-dependency-management
Unify dependency management
2 parents 13910a5 + 47ecd72 commit d0784c4

40 files changed

Lines changed: 30 additions & 397 deletions

File tree

‎_template/build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
apply plugin: "java"
2-
apply plugin: "eclipse"
3-
apply plugin: "idea"
4-
5-
repositories {
6-
mavenCentral()
7-
}
8-
9-
dependencies {
10-
testCompile "junit:junit:4.10"
11-
}

‎accumulate/build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
apply plugin: "java"
2-
apply plugin: "eclipse"
3-
apply plugin: "idea"
4-
5-
repositories {
6-
mavenCentral()
7-
}
8-
9-
dependencies {
10-
testCompile "junit:junit:4.10"
11-
}

‎allergies/build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
apply plugin: "java"
2-
apply plugin: "eclipse"
3-
apply plugin: "idea"
4-
5-
repositories {
6-
mavenCentral()
7-
}
8-
9-
dependencies {
10-
testCompile "junit:junit:4.10"
11-
}

‎anagram/build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
apply plugin: "java"
2-
apply plugin: "eclipse"
3-
apply plugin: "idea"
4-
5-
repositories {
6-
mavenCentral()
7-
}
8-
9-
dependencies {
10-
testCompile "junit:junit:4.10"
11-
}
Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,76 @@
1-
import static org.hamcrest.CoreMatchers.*;
2-
import static org.junit.matchers.JUnitMatchers.*;
3-
import static org.junit.Assert.*;
1+
import static org.assertj.core.api.Assertions.assertThat;
42

5-
import java.util.*;
6-
import org.junit.*;
3+
import java.util.Arrays;
4+
import java.util.List;
5+
import org.junit.Test;
76

87
public class AnagramTest {
98

109
@Test
1110
public void testNoMatches() {
1211
Anagram detector = new Anagram("diaper");
13-
assertTrue(detector.match(Arrays.asList("hello", "world", "zombies", "pants")).isEmpty());
12+
assertThat(detector.match(Arrays.asList("hello", "world", "zombies", "pants"))).isEmpty();
1413
}
1514

1615
@Test
1716
public void testSimpleAnagram() {
1817
Anagram detector = new Anagram("ant");
1918
List<String> anagram = detector.match(Arrays.asList("tan", "stand", "at"));
20-
assertThat(anagram, hasItems("tan"));
19+
assertThat(anagram).containsExactly("tan");
2120
}
2221

2322
@Test
2423
public void testDetectMultipleAnagrams() {
2524
Anagram detector = new Anagram("master");
2625
List<String> anagrams = detector.match(Arrays.asList("stream", "pigeon", "maters"));
27-
assertThat(anagrams, hasItems("maters", "stream"));
26+
assertThat(anagrams).contains("maters", "stream");
2827
}
2928

3029
@Test
3130
public void testDoesNotConfuseDifferentDuplicates() {
3231
Anagram detector = new Anagram("galea");
3332
List<String> anagrams = detector.match(Arrays.asList("eagle"));
34-
assertTrue(anagrams.isEmpty());
33+
assertThat(anagrams).isEmpty();
3534
}
3635

3736
@Test
3837
public void testIdenticalWordIsNotAnagram() {
3938
Anagram detector = new Anagram("corn");
4039
List<String> anagrams = detector.match(Arrays.asList("corn", "dark", "Corn", "rank", "CORN", "cron", "park"));
41-
assertEquals(anagrams, Arrays.asList("cron"));
40+
assertThat(anagrams).containsExactly("cron");
4241
}
4342

4443
@Test
4544
public void testEliminateAnagramsWithSameChecksum() {
4645
Anagram detector = new Anagram("mass");
47-
assertTrue(detector.match(Arrays.asList("last")).isEmpty());
46+
assertThat(detector.match(Arrays.asList("last")).isEmpty());
4847
}
4948

5049
@Test
5150
public void testEliminateAnagramSubsets() {
5251
Anagram detector = new Anagram("good");
53-
assertTrue(detector.match(Arrays.asList("dog", "goody")).isEmpty());
52+
assertThat(detector.match(Arrays.asList("dog", "goody"))).isEmpty();
5453
}
5554

5655
@Test
5756
public void testDetectAnagrams() {
5857
Anagram detector = new Anagram("listen");
5958
List<String> anagrams = detector.match(Arrays.asList("enlists", "google", "inlets", "banana"));
60-
assertThat(anagrams, hasItems("inlets"));
59+
assertThat(anagrams).contains("inlets");
6160
}
6261

6362
@Test
6463
public void testMultipleAnagrams() {
6564
Anagram detector = new Anagram("allergy");
6665
List<String> anagrams = detector.match(Arrays.asList("gallery", "ballerina", "regally", "clergy", "largely", "leading"));
67-
assertThat(anagrams, hasItems("gallery", "largely", "regally"));
66+
assertThat(anagrams).contains("gallery", "largely", "regally");
6867
}
6968

7069
@Test
7170
public void testAnagramsAreCaseInsensitive() {
7271
Anagram detector = new Anagram("Orchestra");
7372
List<String> anagrams = detector.match(Arrays.asList("cashregister", "Carthorse", "radishes"));
74-
assertThat(anagrams, hasItems("Carthorse"));
73+
assertThat(anagrams).contains("Carthorse");
7574
}
7675

7776
}

‎atbash-cipher/build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
apply plugin: "java"
2-
apply plugin: "eclipse"
3-
apply plugin: "idea"
4-
5-
repositories {
6-
mavenCentral()
7-
}
8-
9-
dependencies {
10-
testCompile "junit:junit:4.10"
11-
}

‎binary/build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
apply plugin: "java"
2-
apply plugin: "eclipse"
3-
apply plugin: "idea"
4-
5-
repositories {
6-
mavenCentral()
7-
}
8-
9-
dependencies {
10-
testCompile "junit:junit:4.10"
11-
}

‎bob/build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
apply plugin: "java"
2-
apply plugin: "eclipse"
3-
apply plugin: "idea"
4-
5-
repositories {
6-
mavenCentral()
7-
}
8-
9-
dependencies {
10-
testCompile "junit:junit:4.10"
11-
}

‎build.gradle‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
subprojects { project ->
22
apply plugin: "java"
3+
apply plugin: "eclipse"
4+
apply plugin: "idea"
5+
6+
repositories {
7+
mavenCentral()
8+
}
9+
10+
dependencies {
11+
testCompile "junit:junit:4.12"
12+
testCompile 'org.assertj:assertj-core:2.2.0'
13+
}
314

415
sourceSets {
516
// Verify that the tests are working by running them against the example code.

‎crypto-square/build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
apply plugin: "java"
2-
apply plugin: "eclipse"
3-
apply plugin: "idea"
4-
5-
repositories {
6-
mavenCentral()
7-
}
8-
9-
dependencies {
10-
testCompile "junit:junit:4.10"
11-
}

0 commit comments

Comments
 (0)