class Insist
Insist
on correctness.
Example:
data = { "hello" => "world" } insist { data["hello"] } == "world"
This class aims to work similarly to how rspec’s “should” stuff does, but instead of molesting Object allows you to neatly wrap values with blocks while still checking for expected values.
Public Class Methods
Source
# File lib/insist.rb, line 41 def initialize(&block) @callback = block end
Create a new insist with a block.
Example:
Insist.new { value }
Better:
insist { value }
Public Instance Methods
Source
# File lib/insist.rb, line 45 def value # TODO(sissel): make caching the value optional @value ||= @callback.call return @value end