Open runlevel5 opened 12 years ago
Hi,
Could you provide more info? Check the console output CTRL+`
Br, Grzegorz
Given a simple minitest file at test/unit/my_test.rb
require 'minitest_helper'
describe MyTest do
describe 'the test' do
it 'should be true' do
true.must_equal true
end
end
end
The message returned from ctrl-shift-r (inside the 'should be true' block) is "No test name!"
ctrl-shift-t works just fine...
Hi,
problem here is that test file name is exact same as unit tests (my_test.rb) For cucumber and rspec it was easier as they are subfixes as _spec, ..._feature Therefor we would need to extend regexp of unit tests.
We will try to figure it out.
Br, Grzegorz
The regex to capture the test name is easy enough (within UnitTest)
if not match_obj:
match_obj = re.search('\s?([\"\'][a-zA-Z_\s\d]+[\"\'])\s+ti', test_file_content) # 3rd search for 'it "name"' - Minitest::Spec
However the test_name variable needs a counter prepended representing it's position within that spec. http://bfts.rubyforge.org/minitest/MiniTest/Spec.html E.g. The test names from
describe 'the first test' do
it 'should definitely be true' do
true.must_equal true
end
end
describe 'the test' do
it 'should be true' do
true.must_equal true
end
it 'should be false' do
false.must_equal false
end
end
are
test_0001_should_definitely_be_true
test_0001_should_be_true
test_0002_should_be_false
which is tricky...
@gs: there is no convention of using the naming _spec
for the test specs though.
I would love this too, if you're still looking into it!
Anything ever happen on this?
:+1:
I have the same problem.
:+1: This is a problem for me too.
I've created a PR to add support for Minitest: https://github.com/maltize/sublime-text-2-ruby-tests/pull/254 Let me know if it works
It seems to me Minitest::Spec specs are not support by Cmd+Shift R.