Rubytest in Sublime Text 2

RubyTest in Sublime Text 2

To get this to work you only need to change one setting in the RubyTest package in sb2.

If you are using rvm, your rspec gem is installed through rvm and is not found in /bin/sh

So you need to set the RubyTest package for Sublime Text 2 to automatically check for your rvm environment variables.

What to change:

1) In Sublime Text 2, go to Preferences|Browse Packages. This will open up your packages directory.

2) Open the 'RubyTest' directory and look for the file 'RubyTest.sublime-settings'.

3) find the line that says:

"check_for_rvm": false,

and change it to:

"check_for_rvm": true,

save the change.

4) That's it. It should now work.

Good Luck

RubyTest with SublimeText 2

How are you starting the sublime?

Following url should help you in starting sublime from terminal, which should fix this problem
http://www.sublimetext.com/docs/2/osx_command_line.html

Sublime Text 2 - RubyTest with ruby 2.0 not working

The error seems pretty explanatory:

You have already activated rspec-core 2.13.0, but your Gemfile requires rspec-core 2.11.1. Using bundle exec may solve this. (Gem::LoadError)

Either adjust the version of your rspec-rails (containing rspec-core) or run with bundle exec.

Solution:

Within your gemfile, change:

gem 'rspec-rails', '2.11.0' 

To:

gem 'rspec rails', '2.13.0'

Sublime Test 2 RubyTest not showing any results

I think I might have the right solution for you, as I've just run into the same problem and solved it.

First, find out what's causing the "Building..." error with RubyTest by digging into the Sublime Text 2 console (View > Show Console).

This was my console output:

Running rspec spec/requests/static_pages_spec.rb -l15
Traceback (most recent call last):
File "./sublime_plugin.py", line 337, in run_
File "./exec.py", line 154, in run
File "./exec.py", line 45, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 72: ordinal not in range(128)
reloading /Users/Jonathan/Library/Application Support/Sublime Text 2/Packages/User/RubyTest.last-run

Taken from here, it turns out ST2 tries to evaluate all shell expressions.

From the same link, here's how I fixed it: go to Library > Application Support > Sublime Text 2 > Packages > Default and edit exec.py starting at the for loop at line 45:

for k, v in proc_env.iteritems():
path_vars = os.path.expandvars(v)
if isinstance(path_vars, unicode):
path_vars = path_vars.encode(sys.getfilesystemencoding())
proc_env[k] = path_vars

Hope this solved your problem!

Rails: test code in lib directory with RubyTest with Sublime Text 2

The configuration file of RubyTest in Sublime Text 2 is here:

~/.config/sublime-text-2/Packages/RubyTest/RubyTest.sublime-settings

I added lib to the -I option in the ruby_unit_exec like that:

"ruby_unit_exec": "ruby -Ilib:test"`

The problem is fixed.

Sublime Text 3, rbenv, TestUnit, RubyTest and Spring correct configuation to get tests working

This will do the trick

"run_ruby_unit_command": "export PATH=~/.rbenv/shims:$PATH; bin/rake test -Itest {relative_path}",
"run_single_ruby_unit_command": "export PATH=~/.rbenv/shims:$PATH; bin/rake test {relative_path} {test_name}",


Related Topics



Leave a reply



Submit