Skip to content

Instantly share code, notes, and snippets.

@alex-zige
Last active December 16, 2015 04:59
Show Gist options
  • Save alex-zige/5381118 to your computer and use it in GitHub Desktop.
Save alex-zige/5381118 to your computer and use it in GitHub Desktop.
Zeus Rspec super fast testing. [better testing suite ]

Zeus + Rspec + Guard [better testing suite ]

Zeus is great spork-like tool for forking the rake enviroment for better performance. It's great for rspec even faster than spork with ndb setup.

#install Zeus

gem install zeus

#install Zeus for guard

in your gem file, add

gem 'zeus'

gem 'guard-zeus'

then run bundle install

config Guard with Zeus

open Guardfile. in rspec block, change params to be:

guard 'rspec', :version => 2, all_on_start: false, all_after_pass: false, zeus: true, bundler: false do end

Then in your spec_helper.rb

remove require 'rspec/autorun'

require 'rspec/autotest'

#Start Zeus zues start

Restart Zeus

edit the boot.rb file or re save it

Tips

if the zeus rake and zeus cucumber is on waiting, try to remove the .zeus.socket file and zeus start again to active the zeus again.

Start Guard

bundle exec guard

Alternative

Or if you are a big fan of Sublime Text, now there is a Zeus addon for that.

In your Sublime Text 2 => Perference => Packages Settings=> RubyTesting =>Setting - User

update the config file as below

{

  "run_cucumber_command": "zeus cucumber {relative_path} --no-color",
  "run_single_cucumber_command": "zeus cucumber {relative_path}:{line_number} --no-color",

  "run_rspec_command": "zeus rspec {relative_path}",
  "run_single_rspec_command": "zeus rspec {relative_path}:{line_number}",

  "check_for_rvm": true,
}

Then Save and reload!

After that you will be able to run command + shift + t to run the test cases.

Happy Testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment