【发布时间】:2013-02-07 10:38:17
【问题描述】:
我想在 irb 中使用 [1,2,3].should include(1)。我试过了:
~$ irb
1.9.3p362 :001 > require 'rspec/expectations'
=> true
1.9.3p362 :002 > include RSpec::Matchers
=> Object
1.9.3p362 :003 > [1,2,3].should include(1)
TypeError: wrong argument type Fixnum (expected Module)
from (irb):3:in `include'
from (irb):3
from /home/andrey/.rvm/rubies/ruby-1.9.3-p362/bin/irb:16:in `<main>'
但是it's a valid case 不起作用。如何使用[1,2,3].should include(1)?
【问题讨论】:
标签: ruby rspec irb rspec-expectations