Code Monkey home page Code Monkey logo

chemistry's Introduction

Chemistry

A testing framework for Elixir.

Installation

available in Hex, the package can be installed as:

  1. Add chemistry to your list of dependencies in mix.exs:
def deps do
  [{:chemistry, "~> 0.1.4"}]
end
  1. Ensure chemistry is started before your application:
def application do
  [applications: [:chemistry]]
end

Examples

From Interactive Elixir, type iex from terminal.

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.

defmodule MathLab do
  use Chemistry.Lab

  it "Can use integers for addition and subtraction." do
    expect 2 + 3 == 5
    expect 5 - 5 == 10
  end

  it "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 Kokalas

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 Apache 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.

chemistry's People

Contributors

genericlady avatar tosbourn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chemistry's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.