Injecting minitest/spec into IntegrationTest?

Hello,

I want to use the minitest/spec DSL inside an
ActionDispatch::IntegrationTest but I’m getting no-method errors:

#-----------------------------------------------------------------

cat test/integration/wacky_integration_test.rb

#-----------------------------------------------------------------
require ‘test_helper’
require ‘minitest/spec’

class WackyIntegrationTest < ActionDispatch::IntegrationTest
before do
p :before
end

describe ‘test’ do
it ‘should be wacky’ do
(2 + 2).must_equal 4
end
end
end

#-----------------------------------------------------------------

ruby -Ilib:test test/integration/wacky_integration_test.rb

#-----------------------------------------------------------------
test/integration/wacky_integration_test.rb:5:in
<class:WackyIntegrationTest>': undefined methodbefore’ for
WackyIntegrationTest:Class (NoMethodError)
from test/integration/wacky_integration_test.rb:4:in `’

Any ideas on how to inject the minitest/spec DSL into IntegrationTest?

Thanks for your consideration.

Suraj K. wrote in post #974504:

I want to use the minitest/spec DSL inside an
ActionDispatch::IntegrationTest but I’m getting no-method errors:

<class:WackyIntegrationTest>': undefined method before’ for
WackyIntegrationTest:Class (NoMethodError)
from test/integration/wacky_integration_test.rb:4:in `’

Well, I gave up on this and used the Contest library[1] instead.
It works out-of-the-box with ActionDispatch::IntegrationTest! :slight_smile:

[1] http://blog.citrusbyte.com/2009/05/19/introducing-contest/