Oleaster Matcher

Jasmine like matchers for Oleaster

License

License

GroupId

GroupId

com.mscharhag.oleaster
ArtifactId

ArtifactId

oleaster-matcher
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Oleaster Matcher
Jasmine like matchers for Oleaster

Download oleaster-matcher

How to add to project

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

Dependencies

test (1)

Group / Artifact Type Version
com.mscharhag.oleaster : oleaster-runner jar 0.1.1

Project Modules

There are no modules declared in this project.

Oleaster

Oleaster allows you to write JUnit tests like you would write Jasmine tests.

An Oleaster JUnit test looks like this:

@RunWith(OleasterRunner.class)
public class OleasterIntroductionTest {{
	describe("A suite", () -> {
		it("contains a spec with an expectation", () -> {
			expect(40 + 2).toEqual(42);
		});
	});
}}

Oleaster consists out of two independent libraries:

The Oleaster JUnit Runner gives you the option to write JUnit tests in the format shown above. Java 8 Lambda expressions are used to structure a test in suites and specifications.

Oleaster-Matcher provides Jasmine-like Matchers (expect(..).toEqual(..)) to validate test results. These Matchers can be used as a replacement (or extension) for standard JUnit assertions.

Documentation and examples

Oleaster JUnit Runner Documentation

Oleaster Matcher Documentation

Source of the AudioPlayer example from the Oleaster Runner documentation.

Oleaster tests are (mostly) written with Oleaster (see: Oleaster JUnit Runner Tests and Oleaster Matcher Tests).

Travis CI builds can be found here

Maven dependencies

<dependencies>

	<!-- Oleaster Matchers -->
	<dependency>
		<groupId>com.mscharhag.oleaster</groupId>
		<artifactId>oleaster-matcher</artifactId>
		<version>0.2.0</version>
    	</dependency>
    
	<!-- Oleaster JUnit runner -->
	<dependency>
		<groupId>com.mscharhag.oleaster</groupId>
		<artifactId>oleaster-runner</artifactId>
		<version>0.2.0</version>
	</dependency>

	<!-- Of course a JUnit runner can only be used with JUnit -->
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>4.11</version>
	</dependency>
	
</dependencies>

License

This software is licensed under the Apache 2 license, quoted below.

Copyright 2017 Michael Scharhag

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Version
0.2.0
0.1.2
0.1.1
0.1.0