[rspec-users] alias :calling :lambda

Pat Maddox pergesu at gmail.com
Wed Sep 19 22:55:49 EDT 2007


On 9/19/07, Jed Hurt <jed.hurt at gmail.com> wrote:
> Sprinkling my examples with 'lambda' has always seemed like a bit of a
> wart to me. I've gotten into the habit of adding 'alias :calling
> :lambda' to my spec suites. My examples then look like:
>
> calling { Foo }.should raise_error
> calling { Bar }.should_not raise_error
>
> Is there a reason that RSpec core has chosen not to make exception
> expectations more sugary?
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>

There's actually a ticket that aliases it to running, I believe.  So
specs would look like

running { Foo }.should raise_error

Pat


More information about the rspec-users mailing list