From: Jeremy McAnally Date: 2009-04-05T02:35:21+09:00 Subject: Re: [Ann] Verify, a very basic testing tool. Not to be contentious, but you use both define_method and *_eval to generate code. Unless I don't know what that term means, I believe you *do* use metaprogramming. Though, I do have a question/concern/confusion/something. I completely and utterly fail to see the point of these new closure obsessed frameworks or tools. Nearly every bit of their functionality could be wrapped up in a few simple helpers like this: class Test::Unit::TestCase alias old_assert assert def assert(result = nil, &block) result = block.call if block_given? old_assert result end end Unless I'm totally missing something? I realize it's a different syntax or "DSL," and that's fine if that's your reasoning, but I don't see how they're all that revolutionary. I like closures as much as the next guy, but I don't see how they revolutionize my testing life. Aimed much less at you, and more at the 4-5 of these I've seen in the past few days. --Jeremy On Fri, Apr 3, 2009 at 3:02 PM, Robert Dober wrote: > Hi List > > The Verify tool is a KISS verification and test tool, it is inspired > by Ara T. Howard's testy.rb. >  Ara however has still implemented a BDD framework, the purpose of > Verify is to provide a Ruby Programmer >  with a very simple yet effective tool to test her assumptions about code. > >  Verify was motivated by a reply to Ara's release post made by Phlip. > Phlip has made an excellent point about assert. >  And that very often that is (almost?) all what is needed. >  The Verify tool tries to implement exactly that idea and is the > simplest possible tool to do the job (for me). > >  Verify has the following goals > >   * Almost nothing to learn, one wrapper method and three test > methods with almost no parameters all save one >     optional. >      # At the end a resume of the verifications with an error message > for each failed verification >      # will be printed to stderr or a mocking object. >      # Strings and Arrays are fine for that purpose, as the reporter > uses #<< exclusively. > > >   * No metaprogramming, no at_exit hook, execution of the > verification inside a wrapper object, no global namespace pollution, >     except the Verify method. > >   * Wrapper behavior inference to the testee is limited to #verify, > #verify_not and #verify_exceptions. > >   * Very simple output > >   * "Last Line Says It All" feature "================" --> all tests > ok, "***************" --> not all tests ok. > > USAGE EXAMPLES: > >        require 'verify' > >        Verify do >          verify do 42 end >          verify_not do nil end >          verify_exceptions NameError do abcdefghijk end >        end > >        Verify "that the universe is ok" do >          verify "this only shows in error reports" do >            1 / 0 >          end >        end > > LICENCE: >        BSD > > Enjoy > Robert > > Ah yeah BTW if someone really wants to download this ;) > > http://rubyforge.org/frs/?group_id=3824&release_id=30476 > > > -- > There are some people who begin the Zoo at the beginning, called > WAYIN, and walk as quickly as they can past every cage until they get > to the one called WAYOUT, but the nicest people go straight to the > animal they love the most, and stay there. ~ A.A. Milne (from > Winnie-the-Pooh) > > -- http://jeremymcanally.com/ http://entp.com/ http://omgbloglol.com My books: http://manning.com/mcanally/ http://humblelittlerubybook.com/ (FREE!)