exkorpion v0.0.2-rc.1 Release Notes
Release Date: 2016-09-02 // over 7 years ago-
Exkorpion
โ Exkorpion is a framework that will help developers to write tests in a BDD form.
Installation
๐ฆ Library is available in Hex, the package can be installed as:
โ Add
exkorpion
to your list of dependencies inmix.exs
:def deps do [{:exkorpion, "~\> 0.0.2-rc.1"}]end
Ensure
exkorpion
is started before your application:def application do [applications: [:exkorpion]]end
Getting started with Exkorpion
โ Wrapping ExUnit to achieve a BDD syntax for our tests.
Below you can find some very basic examples of how to use Exkorpion
defmodule Exkorpion.MathExamplesTest douse Exkorpiondef sum a, b do a + b enddef subs a, b do a - b end scenario "testing sum operation works as expected" do beforeEach do %{a: 12} end it "does multiple operations depending on vairable input" do %{ with: fn ctx -\> [%{param1: ctx.a, param2: 3, result: 15, op: fn a,b -\> sum(a,b) end}, %{param1: 3, param2: -2, result: 5, op: fn a,b -\> subs(a,b) end}] end, given: fn ctx -\> %{a: ctx.param1, b: ctx.param2} end, when: &(%{c: &1.op.(&1.a ,&1.b)}), then: fn ctx -\> assert ctx.c === ctx.result end } endend scenario "testing sum operation works as expected 2" do beforeEach do %{a: 10} end it "sum positive numbers works as expected" do %{ given: &(%{a: &1.a, b: 3}), when: &(%{c: &1.a + &1.b}), then: fn ctx -\> assert ctx.c === 13end } end it "sum negative numbers and it should work as expected" do %{ given: &(%{a: &1.a, b: -2}), when: &(%{c: sum(&1.a ,&1.b)}), then: fn ctx -\> assert ctx.c === 8end } endendend
How to run
- Make a *scenarios directory in your project
- Add files with sufix _scenario.ex or _scenario.exs
- โ Implementing some test as example above.
- Run command MIX_ENV=test mix exkorpion
Project status
- ๐ Improving coding style
- Implementing new functionalities.
- Detecting bugs and fixing them.
- Waitign for feddback.
Contributors
- Ivรกn Corrales Solera , [email protected], @wesovilabs
Stable version
0.0.1 is the stable version
๐ CHANGELOG.md
0.0.2-rc.1 (2016-09-02)
๐ Bug Fixes
There was not bug detected for previous version.
๐จ Code Refactoring
- Applying best coding practice (trying at least XD)
- โ Adding credo to run static code analysis.
๐ Features
- Adding beforeEach functionality
- Raising Assertion Errors, better understanding of assertion errors
- Adding exkorpion examples as part of this project
- Creating a task that will allow us to run the tests by command mix exkorpion