Skip to content

Commit

Permalink
Merge pull request #30 from jtigger/ignore-all-but-first-test
Browse files Browse the repository at this point in the history
Skip all but the first test in each exercise.
  • Loading branch information
sdavids13 authored Feb 7, 2017
2 parents ad99a42 + f817dfc commit 22f9d3a
Show file tree
Hide file tree
Showing 89 changed files with 601 additions and 13 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
language: java
jdk:
- oraclejdk8
script:
- bin/build.sh

# http://docs.travis-ci.com/user/migrating-from-legacy
sudo: false

script:
- bin/unit-tests.sh
14 changes: 8 additions & 6 deletions bin/build.sh → bin/unit-tests.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
pushd exercises
gradle --version
echo ""
echo ">>> Running tests..."
TERM=dumb gradle test --continue
popd

echo ""
echo ">>> Running configlet..."
bin/fetch-configlet
bin/configlet .

pushd exercises
echo ""
echo ">>> Running tests..."
TERM=dumb gradle check compileStarterSourceKotlin --continue
popd

6 changes: 6 additions & 0 deletions exercises/_template/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
6 changes: 6 additions & 0 deletions exercises/accumulate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
7 changes: 7 additions & 0 deletions exercises/accumulate/src/test/kotlin/AccumulateTest.kt
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
import org.junit.Test
import org.junit.Ignore
import kotlin.test.assertEquals

class AccumulateTest {


@Test
fun emptyAccumulateProducesEmptyAccumulation() {
val input = listOf<Int>()
val expectedOutput = listOf<Int>()
assertEquals(expectedOutput, Accumulate.accumulate(input, { x -> x * x }))
}

@Ignore
@Test
fun accumulateSquares() {
val input = listOf(1, 2, 3)
val expectedOutput = listOf(1, 4, 9)
assertEquals(expectedOutput, Accumulate.accumulate(input, { x -> x * x }))
}

@Ignore
@Test
fun accumulateUpperCases() {
val input = listOf("hello", "world")
val expectedOutput = listOf("HELLO", "WORLD")
assertEquals(expectedOutput, Accumulate.accumulate(input, { it.toUpperCase() }))
}

@Ignore
@Test
fun accumulateReversedStrings() {
val input = "the quick brown fox etc".split(" ")
val expectedOutput = "eht kciuq nworb xof cte".split(" ")
assertEquals(expectedOutput, Accumulate.accumulate(input, { it.reversed() }))
}

@Ignore
@Test
fun accumulateWithinAccumulate() {
val input1 = listOf("a", "b", "c")
Expand All @@ -41,6 +47,7 @@ class AccumulateTest {
))
}

@Ignore
@Test
fun accumulateToDifferentType() {
val input = listOf(1, 2, 3)
Expand Down
6 changes: 6 additions & 0 deletions exercises/acronym/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
7 changes: 7 additions & 0 deletions exercises/acronym/src/test/kotlin/AcronymTest.kt
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
import org.junit.Test
import org.junit.Ignore
import kotlin.test.assertEquals

class AcronymTest {


@Test
fun fromTitleCasedPhrases() {
val phrase = "Portable Network Graphics"
val expected = "PNG"
assertEquals(expected, Acronym.generate(phrase))
}

@Ignore
@Test
fun fromOtherTitleCasedPhrases() {
val phrase = "Ruby on Rails"
val expected = "ROR"
assertEquals(expected, Acronym.generate(phrase))
}

@Ignore
@Test
fun fromInconsistentlyCasedPhrases() {
val phrase = "HyperText Markup Language"
val expected = "HTML"
assertEquals(expected, Acronym.generate(phrase))
}

@Ignore
@Test
fun fromPhrasesWithPunctuation() {
val phrase = "First In, First Out"
val expected = "FIFO"
assertEquals(expected, Acronym.generate(phrase))
}

@Ignore
@Test
fun fromOtherPhrasesWithPunctuation() {
val phrase = "PHP: Hypertext Preprocessor"
val expected = "PHP"
assertEquals(expected, Acronym.generate(phrase))
}

@Ignore
@Test
fun fromPhrasesWithPunctuationAndSentenceCasing() {
val phrase = "Complementary metal-oxide semiconductor"
Expand Down
6 changes: 6 additions & 0 deletions exercises/allergies/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
20 changes: 20 additions & 0 deletions exercises/allergies/src/test/kotlin/AllergiesTest.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import org.junit.Test
import org.junit.Ignore
import kotlin.test.assertEquals

class AllergiesTest {


@Test
fun noAllergiesMeansNotAllergicToAnything() {
val allergies = Allergies(0)
Expand All @@ -13,76 +15,87 @@ class AllergiesTest {
assertEquals(false, allergies.isAllergicTo(Allergen.CATS))
}

@Ignore
@Test
fun allergicToEggs() {
val allergies = Allergies(1)

assertEquals(true, allergies.isAllergicTo(Allergen.EGGS))
}

@Ignore
@Test
fun allergicToPeanuts() {
val allergies = Allergies(2)

assertEquals(true, allergies.isAllergicTo(Allergen.PEANUTS))
}

@Ignore
@Test
fun allergicToShellfish() {
val allergies = Allergies(4)

assertEquals(true, allergies.isAllergicTo(Allergen.SHELLFISH))
}

@Ignore
@Test
fun allergicToStrawberries() {
val allergies = Allergies(8)

assertEquals(true, allergies.isAllergicTo(Allergen.STRAWBERRIES))
}

@Ignore
@Test
fun allergicToTomatoes() {
val allergies = Allergies(16)

assertEquals(true, allergies.isAllergicTo(Allergen.TOMATOES))
}

@Ignore
@Test
fun allergicToChocolate() {
val allergies = Allergies(32)

assertEquals(true, allergies.isAllergicTo(Allergen.CHOCOLATE))
}

@Ignore
@Test
fun allergicToPollen() {
val allergies = Allergies(64)

assertEquals(true, allergies.isAllergicTo(Allergen.POLLEN))
}

@Ignore
@Test
fun allergicToCats() {
val allergies = Allergies(128)

assertEquals(true, allergies.isAllergicTo(Allergen.CATS))
}

@Ignore
@Test
fun isAllergicToEggsInAdditionToOtherStuff() {
val allergies = Allergies(5)

assertEquals(true, allergies.isAllergicTo(Allergen.EGGS))
}

@Ignore
@Test
fun noAllergies() {
val allergies = Allergies(0)

assertEquals(0, allergies.getList().size)
}

@Ignore
@Test
fun isAllergicToJustEggs() {
val allergies = Allergies(1)
Expand All @@ -91,6 +104,7 @@ class AllergiesTest {
assertEquals(expectedAllergens, allergies.getList())
}

@Ignore
@Test
fun isAllergicToJustPeanuts() {
val allergies = Allergies(2)
Expand All @@ -99,6 +113,7 @@ class AllergiesTest {
assertEquals(expectedAllergens, allergies.getList())
}

@Ignore
@Test
fun isAllergicToJustStrawberries() {
val allergies = Allergies(8)
Expand All @@ -107,6 +122,7 @@ class AllergiesTest {
assertEquals(expectedAllergens, allergies.getList())
}

@Ignore
@Test
fun isAllergicToEggsAndPeanuts() {
val allergies = Allergies(3)
Expand All @@ -118,6 +134,7 @@ class AllergiesTest {
assertEquals(expectedAllergens, allergies.getList())
}

@Ignore
@Test
fun isAllergicToEggsAndShellfish() {
val allergies = Allergies(5)
Expand All @@ -129,6 +146,7 @@ class AllergiesTest {
assertEquals(expectedAllergens, allergies.getList())
}

@Ignore
@Test
fun isAllergicToLotsOfStuff() {
val allergies = Allergies(248)
Expand All @@ -143,6 +161,7 @@ class AllergiesTest {
assertEquals(expectedAllergens, allergies.getList())
}

@Ignore
@Test
fun isAllergicToEverything() {
val allergies = Allergies(255)
Expand All @@ -160,6 +179,7 @@ class AllergiesTest {
assertEquals(expectedAllergens, allergies.getList())
}

@Ignore
@Test
fun ignoreNonAllergenScoreParts() {
val allergies = Allergies(509)
Expand Down
6 changes: 6 additions & 0 deletions exercises/anagram/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
Loading

0 comments on commit 22f9d3a

Please sign in to comment.