[rspec-devel] deprecations

David Chelimsky dchelimsky at gmail.com
Sun May 27 06:48:13 EDT 2007


Hey all - I just deprecated the symbol mock argument constraints
(which have always felt a little dirty to me) and added methods to
replace them. So instead of these:

mock.should_receive(:message).with(:anything)
mock.should_receive(:message).with(:boolean)
mock.should_receive(:message).with(:numeric)
mock.should_receive(:message).with(:string)

you can do this:

mock.should_receive(:message).with(anything())
mock.should_receive(:message).with(boolean())
mock.should_receive(:message).with(an_instance_of(Numeric))
mock.should_receive(:message).with(an_instance_of(String))

For the moment, I've got deprecation warnings going to STDERR, so
you'll see them when you run rspec's own examples. I'm going to try to
get something a little nicer in place soon. Any recommendations? I
have a couple of ideas, but I want to hear yours.

Cheers,
David


More information about the rspec-devel mailing list