Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulcwarren/ginkgo4j
A Java BDD Testing Framework (based on RSpec and Ginkgo)
https://github.com/paulcwarren/ginkgo4j
bdd eclipse ginkgo intellij java junit rspec spring tdd
Last synced: about 2 months ago
JSON representation
A Java BDD Testing Framework (based on RSpec and Ginkgo)
- Host: GitHub
- URL: https://github.com/paulcwarren/ginkgo4j
- Owner: paulcwarren
- Created: 2016-04-16T00:50:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-03T18:51:52.000Z (3 months ago)
- Last Synced: 2024-10-12T14:15:23.851Z (2 months ago)
- Topics: bdd, eclipse, ginkgo, intellij, java, junit, rspec, spring, tdd
- Language: Java
- Homepage:
- Size: 898 KB
- Stars: 27
- Watchers: 7
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ginkgo4j
## A Java BDD Testing Framework (based on RSpec and [ginkgo](http://onsi.github.io/ginkgo/))
[![Build Status](https://travis-ci.org/paulcwarren/ginkgo4j.svg?branch=master)](https://travis-ci.org/paulcwarren/ginkgo4j)Jump to the [docs](https://paulcwarren.github.io/ginkgo4j) 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:```
com.github.paulcwarren
ginkgo4j
1.0.14
test```
or for a Gradle project add:
```
compile 'com.github.paulcwarren:ginkgo4j:1.0.14'
```or for a Gradle 7 project add:
```
dependencies {
testImplementation 'com.github.paulcwarren:ginkgo4j:1.0.14'
}
```for other build systems see [here](http://search.maven.org/#artifactdetails%7Ccom.github.paulcwarren%7Cginkgo4j%7C1.0.7%7Cjar).
- Create a junit test class
- Add the following imports:
```java
import org.junit.runner.RunWith;
import static com.github.paulcwarren.ginkgo4j.Ginkgo4jDSL.*;
import com.github.paulcwarren.ginkgo4j.Ginkgo4jConfiguration;
import com.github.paulcwarren.ginkgo4j.Ginkgo4jRunner;
```
- Annotate your test class with:-
```java
@RunWith(Ginkgo4jRunner.class)
```
- And the following template:
```java
{
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:-
```java
import org.junit.runner.RunWith;
import static com.github.paulcwarren.ginkgo4j.Ginkgo4jDSL.*;
import com.github.paulcwarren.ginkgo4j.Ginkgo4jSpringRunner;
```
- Annotate your test class with:-
```java
@RunWith(Ginkgo4jSpringRunner.class)
```
- Add the following template:
```java
{
Describe("Replace me", () -> {
It("Replace me too", () -> {
fail("Not yet implemented");
});
});
}
@Test
public void noop() {
}
```## Screenshots
### Eclipse
![Eclipse](readme/eclipse-junit.png)### Intellij
![Intellij](readme/intellij-junit.png)