Skip to content

balance-platform/floppy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Floppy

Library, that dumps your test to files on first run.

On second run test's result are compared with dumps.

Where is it needed?

For example, if you have many tests, which are checking function result, API for example. You can use Floppy

Usage example

test "Returns list of Items in the Cart" do
  cart = Cart.find_by(email: "[email protected])
  items = CartItems.find_by(cart: cart)

  Floppy.assert(items)
end

Floppy.assert on first run generates file with extension .floppy, but on second run items are compared with previous result.

If results are equal, test passed. Otherwise you have to change test or accept new result by command FLOPPY_MODE=rewrite mix test path_to_failed_test.exs

Installation

def deps do
  [
    {:floppy, "~> 0.3.0", only: [:test]}
  ]
end

About

Library for testing data structs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages