开发者

why should_change macro causes deprecation warning in shoulda 2.11.0

开发者 https://www.devze.com 2023-01-04 05:10 出处:网络
DEPRECATION WARNING: You are using deprecated behavio开发者_C百科r which will be removed from the next major or minor release. (called from should_change at /usr/local/lib/ruby/gems/1.8/gems/shoulda-2

DEPRECATION WARNING: You are using deprecated behavio开发者_C百科r which will be removed from the next major or minor release. (called from should_change at /usr/local/lib/ruby/gems/1.8/gems/shoulda-2.11.0/lib/shoulda/macros.rb:40)

How e.g. this kind of test should be changed to work without a warning with new shoulda:

fast_context "a" do
  setup do
    ...
  end

  should_change("message", :by => 1) { Messages.count }      
end


http://robots.thoughtbot.com/post/731871832/this-should-change-your-mind

Good article, explaining how to deal with should_change macros.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号