Recently in ZenTest Category

add_tests("lasgn_call",
          "Rewriter"    => :same,
          "TypeChecker" => t(:lasgn, :c,
                             t(:call,
                               t(:lit, 2, Type.long),
                               :+,
                               t(:arglist,
                                 t(:lit, 3, Type.long)),
                               Type.long),
                             Type.long),
          "CRewriter"   => :same,
          "RubyToAnsiC" => "c = 2 + 3", # FIX: probably not "c = ..."
          "RubyToRubyC" => 'c = rb_funcall(LONG2NUM(2), rb_intern("+"), 1, LONG2NUM(3))')

Can you think of a better / cleaner way? This generates 5 test_lasgn_call methods in 5 different test classes. :same says "use previous output as my input", and Rewriter gets its input from ParseTree's test suite.

I've got 297 of these add_tests method calls. Gah. Just seems a bit much, but I can't really think of a better way ATM.

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking! Use multiruby_setup to manage your installed versions.

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.10.0 / 2008-06-17

mini/test is a completely minimial drop-in replacement for ruby's test/unit. This is meant to be clean and easy to use both as a regular test writer and for language implementors that need a minimal set of methods to bootstrap a working unit test suite.

mini/spec is a functionally complete spec engine.

mini/mock, by Steven Baker, is a beautifully tiny mock object framework.

Changes:

1.2.1 / 2008-06-10

  • 7 minor enhancements:

    • Added deprecations everywhere in test/unit.
    • Added test_order to TestCase. :random on mini, :sorted on test/unit (for now).
    • Big cleanup in test/unit for rails. Thanks Jeremy Kemper!
    • Minor readability cleanup.
    • Pushed setup/run/teardown down to testcase allowing specialized testcases.
    • Removed pp. Tests run 2x faster. :/
    • Renamed deprecation methods and moved to test/unit/deprecate.rb.
  • http://rubyforge.org/projects/bfts

I've been putting a LOT of effort into getting miniunit (still needs a better name... c'mon ppl!) flushed out and polished. This is the release I think is finally ready to replace test/unit in 1.9, but I need your feedback to know how it is. You can help by installing the gem and flipping it on:

% sudo gem install miniunit
% sudo use_miniunit yes

The second command will install symlinks into your sitelib directory. That comes before the stdlib dir in $LOAD_PATH so it'll take over for test/unit. You can roll it out by providing "no" as an argument instead. It should be totally easy and safe.

I've added a lot of really great stuff in this release. The biggies:

  • New useful assertions like assert_includes.
  • A refute mirrors every assert. eg refute_empty ary
  • I added mini/spec and mini/mock and they can work side-by-side with mini/test.

One of the things I did was put a lot of effort into making it work with abusive frameworks like rails (they do bad things to test frameworks). But we used the rails tests in very particular ways, so I don't know if there are other ways that don't work with miniunit.

One thing I'm proud of: Even with all the extra assertions, the spec framework, the mock framework, I still blow test/unit away. Check it:

miniunit

 lib  loc     641 total
 test loc     905 total
 totl loc    1546 total
 flog = 707.623602773533

test/unit

 lib  loc    3571 total
 test loc    2464 total
 totl loc    6035 total
 flog = 3103.27739878118

Rad eh?

So, install it and take it for a spin. Report bugs on rubyforge.

NOTE: Do not report bugs against it if you're trying to use it integrated into a GUI IDE/test-runner like komodo. It isn't meant to be compatible with GUI runners and the like. It is meant to be compatible with your tests.

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.9.3 / 2008-06-09

  • 12 minor enhancements:

    • Added $RUBY env support to autotest so you can swap what ruby to run.
    • Added ALL_HOOKS array to autotest for hook devs.
    • Added EXCLUDED_VERSIONS to multiruby. Integrated with hoe.
    • Added miniunit compatibility to unit_diff's output.
    • Multiruby now determines the latest versions 1.8/1.9 automatically.
    • Removed deprecated :run hook.
    • Fixed zentest_assertions to be compatible with miniunit. Will phase out.
    • Minor autotest plugin cleanup / fixes.
    • Moved assertcallback to test/rails/testcase.rb
    • Reversed assert_includes' arguments.
    • Updated requirements info for other ruby impls.
    • util_capture now returns strings, not iostrings.
  • 1 bug fixes:

    • (add|remove)_(mappings|exceptions) now all return nil to help fix autotest hooks.
  • http://www.zenspider.com/ZSS/Products/ZenTest/

  • http://rubyforge.org/projects/zentest/
  • ryand-ruby@zenspider.com

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.9.2 / 2008-03-20

  • 4 minor enhancements:

    • Added compatibility with miniunit differences.
    • Added emailnotify, jabbernotify, and rcov autotest plugins.
    • Updated rakefile to include examples automatically in exampledotautotest.
    • multiruby now outputs each command so you can grab it easily.
  • 5 bug fixes:

    • Ensure tests are run after reset.
    • Fixed all test/rails tests to run in any combo.
    • Fixed up growl.rb a bit... still buggy (growlnotify, not growl.rb).
    • Fixes for -f (fast start) and last_mtime in general.
    • Fixes for 1.9 and rubinius
  • http://www.zenspider.com/ZSS/Products/ZenTest/

  • http://rubyforge.org/projects/zentest/
  • ryand-ruby@zenspider.com

From a less than inspired blog post comes an awesome comment:

"Autotest is like a super duper little build monkey who throws poo whenever your tests fail."

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.9.1 / 2008-01-31

Something I should have emphasized more in my release notes:

  • Added ability to set test execution order, defaults to :random. EVIL!

What does this mean?

It means that if you ignored my post titled "rake passes but autotest fails?", then autotest is gonna get its revenge when you update. No. Really. It is gonna f' your tests up real good. Why? Because it is Good Testing Practice™ for all your tests to be completely standalone. If I could run your individual tests randomly I'd do that as well(*).

I've had a number of filed bugs and hallway conversations where someone states "blah blah ... but when I run it under autotest, it fails" and somehow they've convinced themselves that it is autotest's fault. "HAH!", I say! Not bloody likely. If your tests aren't written in such a way that each and every individual test can be run in isolation or in any combination and order, then you didn't write tests, you wrote bugs. I really can't emphasize that enough so autotest plans to help you exorcize yourself of these bugs.

Really, you should just take the hit right now and deal with it. But what if your PHB is breathing down your neck? You can tell autotest to run your tests in "Ye Olde Fashioned Sorted Mode" with the following (be sure to copy and paste and fill it out:

Autotest.add_hook :initialize do |at|
  at.order = :alpha  #  I am a bad person. [your name], [today's date]
end

and then make yourself a promise that in 1 month's time autotest will be able to run your tests in any order. Now write it down, and sign it, in blood.

*) I did mention that I wrote miniunit, right? *smile*
**) They probably aren't. PHB's usually won't let you use autotest in the first place. Or write tests for that matter. So if you've gotten this far, you're probably in good shape.

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.9.0 / 2008-01-30

  • 15 minor enhancements:

    • Added Wilson's patch to allow unit_diff to work with mspec. Adding rspec next.
    • Minor overhaul for autotest:
    • Added -f flag to start up without testing.
    • Added -q flag to autotest to make it extra quiet. Patch by Aaron Patterson.
    • Added ability to set test execution order, defaults to :random. EVIL!
    • Added completedre and failedresults_re to help subclasses like rspec.
    • Added deprecation warnings for hooks. Deprecated :run.
    • Added find_directories accessor, defaults to ['.']
    • Added sleep accessor, defaults to 1 second.
    • Changed findfiles to order files in the same order as finddirectories.
    • Changed how autodiscover works with $:, added lib to the front.
    • Cleaned out nearly every @ and use accessor methods instead. You should too.
    • Made test_mappings ordered.
    • Removed @files, adding @findorder and @knownfiles.
    • Renamed testsforfile to testfilesfor.
    • testfilesfor now only returns known files.
  • http://www.zenspider.com/ZSS/Products/ZenTest/

  • http://rubyforge.org/projects/zentest/
  • ryand-ruby@zenspider.com

About this Archive

This page is a archive of recent entries in the ZenTest category.

ZenObfuscate is the previous category.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.1