我想檢查rspec測試(XOR)中兩個可能字符串中是否存在一個。rspec XOR應該包括
有得這樣的效果:
it "worked" do
(
foo.bar.should include "A" AND foo.bar.should_not include "B"
||
foo.bar.should include "B" AND foo.bar.should_not include "A"
)
# => if the above is false rspec should complain
end
這可能嗎?
不知道期望()。甚至是有效的語法替換。 – cjhin