0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby gem to get really clean asserts
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

~> 3.0
 Project Readme

clean_assert

A Ruby library to get really clean asserts.

Usage

Example:

assert / "name != nil" / "not name.empty?" / "age >= 21"

This will do three separate assertion checks and will give you an error message that includes the broken assertion code, the class and the method name. No need for having both the actual assertion and then a strained error message that you normally have to write to understand what broke. Also, due to it's terseness, you can afford having several guard clauses on one line instead of letting them take over your method, which keeps the signal-to-noise ratio sane.

Installation

Add this line to your application's Gemfile:

gem 'clean_assert'

And then execute:

$ bundle

Or install it yourself as:

$ gem install clean_assert

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request