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

做?

4

1 回答 1

1

你可以试试这个(expect-change

expect { parse }.to change{Object.count}.by_at_least(1)
于 2012-11-28T10:09:47.677 回答