I am trying to running a sample test suite from Sublime Text 3.
This is my example that I created using bundle gem foo -t minitest
class TestFoo < MiniTest::Unit::TestCase
def test_that_it_has_a_version_number_test
refute_nil ::Foo::VERSION
end
def test_it_does_something_useful_test
assert true
end
end
I have installed the RubyTest package, and the binding to run the test suite is Ctrl + Shift + T
I get the following error:
/home/thetuxracer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby:1: Invalid char `\x7F' in expression
/home/thetuxracer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby:1: Invalid char `\x02' in expression
/home/thetuxracer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby:1: Invalid char `\x01' in expression
/home/thetuxracer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby:1: Invalid char `\x01' in expression
/home/thetuxracer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby:1:in `<main>': uninitialized constant ELF (NameError)
[Finished in 0.3s with exit code 1]
Observations:
I have installed ruby 2.0.0p247 using rvm. If I run the tests from the CLI, using
ruby -Itest foo_test.rb
the tests run fine.
I also ensured that the key check_for_rvm
in RubyTest.sublime-settings is set to true
What seems to be the problem here? Please let me know if there is anymore information that you may need to help me out.
EDIT: I tried this on a Mac Os X 10.8.4 with ST3 and ruby 2.0.0p247. In the Rakefile, I have also added this line t.test_files = FileList['test/test_*.rb']
in the RakeTask.
I looked at this bug and started ST from the shortcut. But the tests still didnt run.
I tried everything, from changing configurations in existing projects where the minitest runs, to re-installing the ST3 package to reinstalling ruby itself as a last resort. The problem, it turns out was way smaller.
When I execute this command
bundle foo -t minitest
the following files are created:Notice the name of the file containing test cases. I renamed it to
foo_test
and it just worked.I now need to figure out, why minitest needs the filename in that particular format and if possible, change/edit it.