Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finished describable interface with unit tests
- Loading branch information
unknown
authored and
unknown
committed
Aug 12, 2012
0 parents
commit c41d26f
Showing
5 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.classpath | ||
.project | ||
.settings/ | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.visionarysoftwaresolutions</groupId> | ||
<artifactId>describable</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0</version> | ||
<name>Describable</name> | ||
<url>http://www.github.com/leadVisionary/describable</url> | ||
<description>A simple library library for Describable entities, defined as Objects that have a name and a description. </description> | ||
<inceptionYear>August 2012</inceptionYear> | ||
<organization> | ||
<name>Visionary Software Solutions</name> | ||
<url>http://www.visionarysoftwaresolutions.com</url> | ||
</organization> | ||
<scm> | ||
<url>http://www.github.com/leadVisionary/describable</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.spockframework</groupId> | ||
<artifactId>spock-core</artifactId> | ||
<version>0.6-groovy-1.8</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/visionarysoftwaresolutions/describable/Describable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.visionarysoftwaresolutions.describable; | ||
|
||
public interface Describable { | ||
public abstract String getName(); | ||
public abstract String getDescription(); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/groovy/com/visionarysoftwaresolutions/describable/Book.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.visionarysoftwaresolutions.describable | ||
|
||
class Book implements Describable { | ||
String name | ||
String description | ||
|
||
public Book(String name, String description){ | ||
this.name = name | ||
this.description = description | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/test/groovy/com/visionarysoftwaresolutions/describable/DescribableSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.visionarysoftwaresolutions.describable | ||
|
||
class DescribableSpec extends spock.lang.Specification { | ||
Describable toTest | ||
|
||
def setup(){ | ||
toTest = new Book("Lord of the Rings", "Awesome!!!") | ||
} | ||
|
||
def "get name"(){ | ||
when: "I ask for the name of my describable" | ||
def result = toTest.name | ||
then: "the name should be Lord of the Rings" | ||
result == "Lord of the Rings" | ||
} | ||
|
||
def "get description"(){ | ||
when: "I ask for the description of my describable" | ||
def result = toTest.description | ||
then: "the description should be Awesome!!!" | ||
result == "Awesome!!!" | ||
} | ||
} |