On Nov 04, 2008, at 5:07 pm, David Chelimsky wrote:

FYI - if you REALLY want to match against either, it's pretty easy to
do w/ simple matcher:

def be_nil_or_empty
 simple_matcher "nil? or empty? to return true" do |actual|
   actual.nil? || actual.empty?
 end
end


Wow, I completely forgot about simple_matcher. That REALLY deserves a more prominent place in the docs! It's a great feature.

Would be really cool if you could do it like this though:

simple_matcher :be_nil_or_empty, "nil? or empty? to return true" do | actual|
   actual.nil? || actual.empty?
 end

and have it call define_method for you.

That's one I could hopefully do myself in time, after I've got a few Merb/DataMapper jobs out of the way.

WYDAT?  Worth filing a ticket for?

Ashley

--
http://www.patchspace.co.uk/
http://aviewfromafar.net/

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to