# Verify-0.2

**URL:** <https://www.ruby-forum.com/t/verify-0-2/165820>\
**Category:** Ruby\
**Created:** [April 17, 2009, 9:13pm UTC](https://www.ruby-forum.com/t/verify-0-2/165820 "2009-04-17T21:13:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flatekmonkey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e8c25b/32.png) [@flatekmonkey](https://www.ruby-forum.com/u/flatekmonkey)\
**Post date:** [April 17, 2009, 9:13pm UTC](https://www.ruby-forum.com/t/verify-0-2/165820/1 "2009-04-17T21:13:22Z")

</div>

Hi list

this is a bug fix of verify-0.1a introducing mockify.  
It adheres to the basic principles to be very, very simple.  
Hopefully it is useful to somebody, well it is to me :).

[http://rubyforge.org/frs/?group\_id=3824&release\_id=33500](http://rubyforge.org/frs/?group_id=3824&release_id=33500)

- Backtrace information for unexpected exceptions fixed.
- Mockify tool added.
- Using verify and mockify for testing verify and mockify.

By requiring mockify the with\_output method becomes available inside  
Verify blocks.

The result of with\_output calls is $stdout.readlines, but a stringio  
object can  
be specified in addition to capture the output.

Examples:

Verify “Mockify” do  
x = with\_output do  
puts 42  
end  
verify do x == [“42”] end

require ‘stringio’  
out = StringIO::new  
x = with\_output out do  
puts 42  
end  
verify do x == [“42”] end  
verify do out.string == “42\n” end  
x = with\_output out do  
print "hello "  
puts “World”  
end  
verify do x == [“42”, “hello World”] end  
verify do out.string == “42\nhello World\n” end  
end
