spec.rb

Path: lib/minitest/spec.rb
Last Update: Mon Apr 09 13:50:43 +0000 2012

Required files

minitest/unit  

Methods

it   let   subject  

Public Class methods

Define an expectation with name desc. Name gets morphed to a proper test method name. For some freakish reason, people who write specs don‘t like class inheritence, so this goes way out of its way to make sure that expectations aren‘t inherited.

This is also aliased to specify and doesn‘t require a desc arg.

Hint: If you do want inheritence, use minitest/unit. You can mix and match between assertions and expectations as much as you want.

Essentially, define an accessor for name with block.

Why use let instead of def? I honestly don‘t know.

Another lazy man‘s accessor generator. Made even more lazy by setting the name for you to subject.

[Validate]