On Mar 5, 2008, at 9:43 AM, Rick DeNatale wrote:

> And by the way, here's my sketch of how to do this, just looking not
> to reinvent the wheel:

Are you aware that Rails extends Hash with a few extra methods:

mymac:~/rails/myproj $ script/console
Loading development environment (Rails 2.0.2)
 >> a = {:foo=>'bar', :zoo => 'zar'}
=> {:foo=>"bar", :zoo=>"zar"}
 >> a.except(:foo)
=> {:zoo=>"zar"}
 >>

What's cool about this is that you can specify a fully valid hash once  
in a before block, then reuse it, omitting k/v pairs in order to  
verify behavior of missing-value conditions.

This doesn't exactly answer your need, but perhaps it will help.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to