Skip to content

Commit

Permalink
Adding Zeus rubymine adapter script and a couple of tweaks to appease…
Browse files Browse the repository at this point in the history
… zeus
  • Loading branch information
tjgrathwell committed Feb 9, 2013
1 parent 7245467 commit dce2588
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global

# Ignore zeus stuff
zeus.json
custom_plan.rb

# Ignore bundler config
/.bundle

Expand All @@ -19,3 +23,6 @@

# Ignore Redcar directory
.redcar/*

# OSX
.DS_Store
12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ group :development do
gem 'terminal-notifier-guard'
end

group :test, :development do
gem 'sqlite3'
gem 'rspec-rails'
end

group :test do
gem "factory_girl_rails"
gem 'capybara'
Expand All @@ -34,9 +39,4 @@ group :test do
gem "database_cleaner"
gem 'shoulda-matchers'
gem "faker"
end

group :test, :development do
gem 'sqlite3'
gem 'rspec-rails'
end
end
3 changes: 3 additions & 0 deletions script/startzeus
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

env RUBYLIB=/Applications/RubyMine.app/rb/testing/patch/common:/Applications/RubyMine.app/rb/testing/patch/bdd zeus start
38 changes: 38 additions & 0 deletions script/zeus_rspec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env ruby

# Suppress zeus' whining about how it won't use your RAILS_ENV
ENV.delete('RAILS_ENV')

# Zeus 0.13.2 parses options badly. RubyMine will invoke this file like this:
# rspec_runner.rb spec/my_cool_file.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter
#
# ...but Zeus will parse those options thinking --require is meant for it, and die.
# If the test file is moved to the end, it dies less.
ARGV.push(ARGV.shift)

# Add rspec to the beginning of the commands sent to Zeus
ARGV.unshift 'rspec'

require 'rubygems'

def unbundled_load(gem, exec_name)
if defined?(::Bundler)
spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem}-*.gemspec").last
if spec_path.nil?
warn "Couldn't find #{gem}"
return
end

spec = Gem::Specification.load spec_path
spec.activate
bin_path = spec.bin_file exec_name
if bin_path.nil?
warn "Couldn't find binary for #{gem}"
return
end

load bin_path
end
end

unbundled_load 'zeus', 'zeus'

0 comments on commit dce2588

Please sign in to comment.