Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/genericlady/chemistry
Chemistry is a Testing Framework for Elixir
https://github.com/genericlady/chemistry
Last synced: about 1 month ago
JSON representation
Chemistry is a Testing Framework for Elixir
- Host: GitHub
- URL: https://github.com/genericlady/chemistry
- Owner: genericlady
- Created: 2016-12-25T15:42:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-07T21:20:16.000Z (over 6 years ago)
- Last Synced: 2024-10-10T22:46:43.344Z (2 months ago)
- Language: Elixir
- Size: 10.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Testing Framework for Elixir. (Testing)
- fucking-awesome-elixir - chemistry - Testing Framework for Elixir. (Testing)
- awesome-elixir - chemistry - Testing Framework for Elixir. (Testing)
README
# Chemistry
A testing framework for Elixir.
## Installation
[available in Hex](https://hex.pm/packages/chemistry), the package can be installed as:
1. Add `chemistry` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:chemistry, "~> 0.1.4"}]
end
```2. Ensure `chemistry` is started before your application:
```elixir
def application do
[applications: [:chemistry]]
end
```## Examples
From Interactive Elixir, type `iex` from terminal.
```elixir
iex(1)> import Chemistry.Lab
Chemistry.Lab
iex(2)> expect 1 == 1
.:ok
iex(3)> expect 1 > 1
FAILURE:
Expected: 1 to be greater than 1:ok
iex(4)>
```Place all labs inside of `./lab` and be sure to append `_lab.exs` to
anything you want to be a lab.Write expressive tests using a call to `it` followed by a description
for the lab.```elixir
defmodule MathLab do
use Chemistry.Labit "Can use integers for addition and subtraction." do
expect 2 + 3 == 5
expect 5 - 5 == 10
endit "Can use integers for multiplication and division" do
expect 5 * 5 == 25
expect 10 / 2 == 5
end
end
```Run `iex` 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
```## License
Copyright 2016 Yianna KokalasLicensed 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 [Apache
2.0](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.