なぜ
lambda {
parse
}.should change(Object.all, :length).by_at_least(1)
動作しない間
obj_count_before=Object.all.length
parse
Object.all.length.should >= obj_count_before +1
しますか?
なぜ
lambda {
parse
}.should change(Object.all, :length).by_at_least(1)
動作しない間
obj_count_before=Object.all.length
parse
Object.all.length.should >= obj_count_before +1
しますか?
代わりにこれを試すことができます(expect-change)
expect { parse }.to change{Object.count}.by_at_least(1)