Chr*_* P. 19
一种方法:
before_all do |lane|
if lane == :test
puts "Do something for test"
else
puts "foo"
end
end
Run Code Online (Sandbox Code Playgroud)
与您的评论有关的补充
lanes = [:test, :foo, :bar]
lanes.include?(:test) # => true
lanes.include?(:baz) # => false
Run Code Online (Sandbox Code Playgroud)
所以你可以做点什么
before_all do |lane|
lanes_to_say_foo = [:test, :build, :other]
if lanes_to_say_foo.include?(lane)
puts "Foo"
end
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2883 次 |
| 最近记录: |