SORU
12 Kasım 2009, PERŞEMBE


Nasıl rspec'In should_raise hariç her türlü ile kullanmak için?

Böyle bir şey yapmak istiyorum:

some_method.should_raise <any kind of exception, I don't care>

Bu ne yapmalıyım?

some_method.should_raise exception

... çalışmıyor.

CEVAP
12 Kasım 2009, PERŞEMBE


expect { some_method }.to raise_error

1 Sözdizimi RSpec:

lambda { some_method }.should raise_error

Daha fazlası için* *8 (RSpec 1 sözdizimi) ve RSpec 2 documentation bkz.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • ImBluecams

    ImBluecams

    25 Kasım 2012
  • jonathepianist

    jonathepiani

    31 Temmuz 2008
  • whatever

    whatever

    30 EYLÜL 2005