Skip to content

indigotechtutorials/testaroni

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Testaroni

🍕 a fun and simple testing framework for ruby code.

Installation

gem install testaroni

Example

file: my_test.rb

require 'testaroni'

test "Make sure my value is equal" do
  value = 100
  make_sure(value).equals(100)
end

test "Make sure my value is not equal" do
  value = 200
  make_sure(value).is_not(100)
end

ruby my_test.rb

Output:

🍕 Running tests now!
✅ Test passed
✅ Test passed

CLI Command

You can run testaroni in a project and it will look for a /tests folder and run all ruby files inside.

Basic Assertions

The basic assertions you can use are make_sure which takes a value and then gets access to sub methods equals/is_not

make_sure(1).equals(1)
make_sure(1).is_not(2)

Should

You can use the should keyword to get access to file helper methods. for example

should { have "app.rb" }

this will make sure the project contains a certain file.

Details

Testaroni is simple and basic, nothing fancy just enough to make testing work. For me this is perfect.

It allows certain things other libraries don't like. for example

order dependent tests. I know this a bad way of design but what If. I just want my test to read like a long script that performs a simulated task and test it all the way long then being able to write a test class with multiple tests and run it in order is perfectly reasonable.

How to use

  1. create a ruby file and include testaroni gem

  2. write your first test using the test keyword and passing a string to describe the test and a block

  3. use the make_sure keyword to start your test evaluation.

  4. pass a value to make_sure then you can use one of the evaluation helpers

  5. use the equals or is_not keyword for evaluation

  6. run the file in terminal

About

Test your ruby code! Simple and fast

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages