Ginkgo 4 Java

Ginkgo-style testing for Java

License

License

GroupId

GroupId

com.github.paulcwarren
ArtifactId

ArtifactId

ginkgo4j
Last Version

Last Version

1.0.14
Release Date

Release Date

Type

Type

jar
Description

Description

Ginkgo 4 Java
Ginkgo-style testing for Java
Project URL

Project URL

https://github.com/paulcwarren/ginkgo4j
Project Organization

Project Organization

Paul Warren
Source Code Management

Source Code Management

http://github.com/paulcwarren/ginkgo4j

Download ginkgo4j

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.paulcwarren/ginkgo4j/ -->
<dependency>
    <groupId>com.github.paulcwarren</groupId>
    <artifactId>ginkgo4j</artifactId>
    <version>1.0.14</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.paulcwarren/ginkgo4j/
implementation 'com.github.paulcwarren:ginkgo4j:1.0.14'
// https://jarcasting.com/artifacts/com.github.paulcwarren/ginkgo4j/
implementation ("com.github.paulcwarren:ginkgo4j:1.0.14")
'com.github.paulcwarren:ginkgo4j:jar:1.0.14'
<dependency org="com.github.paulcwarren" name="ginkgo4j" rev="1.0.14">
  <artifact name="ginkgo4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.paulcwarren', module='ginkgo4j', version='1.0.14')
)
libraryDependencies += "com.github.paulcwarren" % "ginkgo4j" % "1.0.14"
[com.github.paulcwarren/ginkgo4j "1.0.14"]

Dependencies

compile (3)

Group / Artifact Type Version
junit : junit jar
org.springframework : spring-test jar
commons-io : commons-io jar 2.8.0

test (5)

Group / Artifact Type Version
org.mockito : mockito-core jar
org.hamcrest : hamcrest-all jar 1.3
com.jayway.awaitility : awaitility jar 1.7.0
org.springframework.boot : spring-boot-starter jar
org.springframework.boot : spring-boot-starter-test jar

Project Modules

There are no modules declared in this project.

Ginkgo4j

A Java BDD Testing Framework (based on RSpec and ginkgo)

Build Status

Jump to the the docs to see more.

Feature List:-

  • Structure your BDD-style tests expressively:

    • Nestable Describe and Context container blocks
    • BeforeEach and AfterEach blocks for setup and teardown
    • It blocks that hold your assertions
    • JustBeforeEach blocks that separate creation from configuration (also known as the subject action pattern).
  • Fast testing with parallel execution

  • Test runners that lets you:

    • Focus tests through FDescribe, FContext and FIt constructs
    • Test your Spring applications

Requires

  • Java 8

Getting Started

  • Add the ginkgo4j to your project as a test dependency. For a maven project add:-
<dependency>
    <groupId>com.github.paulcwarren</groupId>
    <artifactId>ginkgo4j</artifactId>
    <version>1.0.7</version>
    <scope>test</scope>
</dependency>

or for a Gradle project add:- compile 'com.github.paulcwarren:ginkgo4j:1.0.7'

for other build systems see here.

  • Create a junit test class
    • Add the following imports:-
import static com.github.paulcwarren.ginkgo4j.Ginkgo4jDSL.*;
import com.github.paulcwarren.ginkgo4j.Ginkgo4jRunner;
  • Annotate your test class with:-
@RunWith(Ginkgo4jRunner.class)
  • And the following template:-
	{
		Describe("Replace me", () -> {
			It("Replace me too", () -> {
				fail("Not yet implemented");
			});
		});
	}
  • Optionally, you can control the number of threads used with @Ginkgo4jConfiguration(threads = 1)

Getting Started with Spring

  • Add the following imports:-
import static com.github.paulcwarren.ginkgo4j.Ginkgo4jDSL.*;
import com.github.paulcwarren.ginkgo4j.Ginkgo4jSpringRunner;
  • Annotate your test class with:-
@RunWith(Ginkgo4jSpringRunner.class)
  • Add the following template:-
	{
		Describe("Replace me", () -> {
			It("Replace me too", () -> {
				fail("Not yet implemented");
			});
		});
	}
	@Test
	public void noop() {
	}

Screenshots

Eclipse

Eclipse

Intellij

Intellij

Versions

Version
1.0.14
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0