简体   繁体   English

rspec在使用rails时使用拐点吗?

[英]does rspec when using rails use inflection?

I am reading through the michael hartl tutorial ; 我正在阅读michael hartl教程 ; with a model user that has a method "follow"; 与模型用户有一个方法“跟随”; One of the tests has an assertion like "should_not be_following" so I assume inflection is used here internally to find the follow method? 其中一个测试有一个类似“should_not be_following”的断言,所以我假设在内部使用拐点来找到跟随方法?

Nope, it's using RSpec's own rule around predicate methods : 不, 它使用RSpec自己的谓词方法规则

thing.should_not be_following

is just shorthand for 只是简写

thing.following?.should_not be(true)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM