.. role

ruby(code)

:language: ruby
.. role

sh(code)

:language: sh

asrt

.. image

img.shields.io/license/MIT.png?color=green

:alt: MIT License
:target: http://opensource.org/licenses/MIT

Introduction


‘This gem <rubygems.org/gems/asrt>`_ simply gives you :ruby:`asrt` so you can do

.. code-block

ruby

def funny(input)
  asrt input.is_a?(String), 'Me only eat strings.'

  input + ' is funny'
end

Why use :ruby:‘asrt` rather than :ruby:`assert`? Well, it’s short and you may like to use some other assert stuff for your unit tests.

Installation


.. code-block

sh

gem install asrt

In your “Gemfile“ may want to have :ruby:‘gem ’asrt’‘.

Dependencies .….….…

None.

Examples


.. code-block

ruby

def funny(input)
  asrt input.is_a?(String), 'Me only eat strings.'

  input + ' is funny'
end

Contribute