You pass the before method an optional symbol and a code block.
您向before方法传递一个可选的标志和一个代码块。
The symbol determines how often RSpec should execute the code block.
标志确定RSpec执行代码块的频率。
The default symbol is: each, meaning RSpec will call the set up block before each test.
默认的标志为:each,表示RSpec将在每次测试之前调用set u p代码块。
应用推荐