处理 rspec(2.14.1)、rspec-core (2.14.8) 和 rspec-expectations(2.14.5) 版本
需要期待两个特定输出之一。尝试了以下语句并得到了相应的错误,
expect(fruit).should be_in('Apple','Mango')
错误
NoMethodError: undefined method `should' for #<RSpec::Expectations::ExpectationTarget:0x007fa63c4336d8>
和
expect(fruit).to eq('Apple').or(eq('Mango'))
和
expect(fruit).to include('Apple').or(eq('Mango'))
错误
NoMethodError: undefined method `or' for #<RSpec::Matchers::BuiltIn::Eq:0x007fa63c431630>
搜索了很多,但找不到解决方案。有没有办法做到这一点而不必将 rspec 更新为 3?