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

  • Digital Bounds

    Digital Boun

    19 Temmuz 2013
  • Video-Tutorials.Net

    Video-Tutori

    15 Mart 2011
  • wowchick16

    wowchick16

    17 Mart 2007