Hi!
I created a new package for running executable specifications, like Cucumber (or closer to Pythons Behave actually). This is a tool that is part of doing Behavior Driven Development (BDD). If you have used Cucumber-like software for other languages you will have a good idea of what this tries to do.
Here is a link to GitHub:
https://github.com/erikedin/ExecutableSpecifications.jl
In short, you can write specifications in a (semi-)natural langugage, like this:
Feature: Coffee machine
Scenario: Coffee with milk
Given that the machine has both coffee beans and milk
When the "Coffee with milk" button is pressed
Then both coffee and milk is dispensed into the cup
Each Given, When, and Then executes a predefined function, defined like this:
using ExecutableSpecifications: @given, @when, @then, @expect
using CoffeeMachine
@given "that the machine has both coffee beans and milk" begin
cup = CoffeeCup()
machine = CoffeeMachine(cup, coffeebeans=100, milk=10)
context[:machine] = machine
context[:cup] = cup
end
@when "the "Coffee with milk" button is pressed" begin
machine = context[:machine]
machine.pressedCoffeeWithMilk()
end
@then "both coffee and milk is dispensed into the cup" begin
cup = context[:cup]
@expect hascoffee(cup)
@expect hasmilk(cup)
end
One of the advantages of writing requirements like this is that non-developers can read and understand the Gherkin specifications, while still getting an executable test which can be run reliably and quickly.
My package is still in early development. It can read specifications and execute simple ones, but is not quite ready for use yet.