[Ann] Verify-0.2

Discussion in 'Ruby' started by Robert Dober, Apr 17, 2009.

  1. Robert Dober

    Robert Dober Guest

    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


    * 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
    Robert Dober, Apr 17, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fred
    Replies:
    0
    Views:
    723
  2. Kathy Burke

    Verify Database Update

    Kathy Burke, Aug 1, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    372
  3. LL

    verify control?

    LL, Nov 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    358
  4. Robert Dober
    Replies:
    30
    Views:
    372
    Suraj Kurapati
    Apr 30, 2009
  5. Robert Dober
    Replies:
    2
    Views:
    97
    Robert Dober
    Jun 24, 2009
Loading...

Share This Page