我想要測試是否陣列包括另一個(rspec的2.11.0)rspec數組應包含哪些內容?另一個陣列
這是結果 RSpec的規格/ test.spec ..F
Failures:
1) 1 3 7
Failure/Error: it { should include(test_arr) }
expected [1, 3, 7] to include [1, 3]
# ./spec/test.spec:7:in `block (2 levels) in <top (required)>'
Finished in 0.00125 seconds
3 examples, 1 failure
Failed examples:
rspec ./spec/test.spec:7 # 1 3 7
include rspec mehod no接受數組參數,這是避免「eval」的更好方法嗎?
非常有趣的聯繫 – GioM
OMG!這是令人興奮的......嚴重的是,這在規範中非常有用,我不知道#include支持的參數列表。謝謝! –