minitest/spec: must_include backwards?

S

Suraj Kurapati

Hello,

In minitest/spec (version 1.3.0), the must_include assertion is
backwards:

require 'rubygems'
require 'minitest/spec'
MiniTest::Unit.autorun

describe 'foo' do
it 'bar' do
5.must_include [5] # <== passes
[5].must_include 5 # <== fails
end
end

I want to write:

list.must_include(item)

not:

item.must_include(list)

Is this a known bug/feature?

Thanks for your consideration.
 
S

Suraj Kurapati

Suraj said:
In minitest/spec (version 1.3.0),
the must_include assertion is backwards:

require 'rubygems'
require 'minitest/spec'
MiniTest::Unit.autorun

describe 'foo' do
it 'bar' do
5.must_include [5] # <== passes
[5].must_include 5 # <== fails
end
end

minitest 1.3.1 fixes this problem and both assertions pass.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top