What have you found for these years?

2009-01-06

rspec bug???

updated:
發現跟 dkubb/dm-core 有關的樣子... 唉
最後只好這樣寫:

begin
@model.all(kind => 3).destroy!

rescue => e
e.should be_an_instance_of(ArgumentError)

end



lambda{f}.should raise_error(ArgumentError)
這怎麼叫都會變成說 nothing was raised.

lambda{f}.should raise_error(ArgumentError, 'blah')
這樣會有東西出來,卻是說:

expected ArgumentError with "blah",
got #<ArgumentError: blah>

但是用:
lambda{f}.should_not raise_error(ArgumentError)
又會告訴我:

expected no ArgumentError,
got #<ArgumentError: blah>

但如果是:
lambda{f}.should_not raise_error(ArgumentError, 'blah')

就完全沒錯了????

啥鬼???第一次試改就捅這麼大的摟子??我要怎麼繼續試啊??
不能用 ArgumentError??

0 retries:

Post a Comment

All texts are licensed under CC Attribution 3.0