假设你有:
Article.keys.should =~ [:title, :year, :title_length]
在 Rspec 3.0 中
expect(Article.keys).to =~ [:title, :year, :title_length]
除了它失败了:
ArgumentError:
The expect syntax does not support operator matchers, so you must pass a matcher to `#to`.
关键问题:Rspec 3.0 中的=~
操作员匹配器是什么?