- Notifications
You must be signed in to change notification settings - Fork0
genericlady/chemistry
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A testing framework for Elixir.
available in Hex, the package can be installed as:
- Add
chemistry
to your list of dependencies inmix.exs
:
defdepsdo[{:chemistry,"~> 0.1.4"}]end
- Ensure
chemistry
is started before your application:
defapplicationdo[applications:[:chemistry]]end
From Interactive Elixir, typeiex
from terminal.
iex(1)>importChemistry.LabChemistry.Labiex(2)>expect1==1.:okiex(3)>expect1>1FAILURE:Expected:1tobegreaterthan1:okiex(4)>
Place all labs inside of./lab
and be sure to append_lab.exs
toanything you want to be a lab.
Write expressive tests using a call toit
followed by a descriptionfor the lab.
defmoduleMathLabdouseChemistry.Labit"Can use integers for addition and subtraction."doexpect2+3==5expect5-5==10endit"Can use integers for multiplication and division"doexpect5*5==25expect10/2==5endend
Runiex
from the terminal to see an example file message.
iex(1)> MathLab.run.===========================================FAILURE: Can use integers for addition and subtraction.===========================================FAILURE: Expected: 0 to be equal to 10:ok
Copyright 2016 Yianna Kokalas
Licensed under the Apache License, Version 2.0 (the "License"); you maynot use this file except in compliance with the License. You may obtaina copy of the License atApache2.0
Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License.