Skip to content
Browse files

Update zeus/rails.rb / zeus.json to reflect new merged test stuff

  • Loading branch information...
1 parent baf9b6d commit a856041ae701506f8624aab99303cb1ea6d5dc9e @burke committed Sep 15, 2012
Showing with 18 additions and 25 deletions.
  1. +1 −3 examples/zeus.json
  2. +17 −22 rubygem/lib/zeus/rails.rb
View
4 examples/zeus.json
@@ -13,9 +13,7 @@
},
"test_environment": {
"cucumber_environment": {"cucumber": []},
- "test": [],
- "test_helper": {"testrb": []},
- "spec_helper": {"rspec": []}
+ "test_helper": {"test": ["rspec", "testrb"]}
}
}
}
View
39 rubygem/lib/zeus/rails.rb
@@ -8,6 +8,14 @@
module Zeus
class Rails < Plan
+ def deprecated
+ puts "Zeus 0.11.0 changed zeus.json. You'll have to rm zeus.json && zeus init."
+ end
+ alias_method :spec_helper, :deprecated
+ alias_method :testrb, :deprecated
+ alias_method :rspec, :deprecated
+
+
def after_fork
reconnect_activerecord
restart_girl_friday
@@ -82,39 +90,26 @@ def test_environment
$rails_rake_task = 'yup' # lie to skip eager loading
::Rails.application.require_environment!
$rails_rake_task = nil
- $LOAD_PATH.unshift(ROOT_PATH) unless $LOAD_PATH.include?(ROOT_PATH)
- $LOAD_PATH.unshift(ROOT_PATH + "/lib") unless $LOAD_PATH.include?(ROOT_PATH + "/lib")
- if Dir.exist?(ROOT_PATH + "/test")
- test = File.join(ROOT_PATH, 'test')
- $LOAD_PATH.unshift(test) unless $LOAD_PATH.include?(test)
- end
-
- if Dir.exist?(ROOT_PATH + "/spec")
- spec = File.join(ROOT_PATH, 'spec')
- $LOAD_PATH.unshift(spec) unless $LOAD_PATH.include?(spec)
- end
+ $LOAD_PATH.unshift ".", "./lib", "./test", "./spec"
end
def test_helper
- if File.exist?(ROOT_PATH + "/test/minitest_helper.rb")
+ if File.exists?(ROOT_PATH + "/spec/spec_helper.rb")
+ require 'spec_helper'
+ elsif File.exist?(ROOT_PATH + "/test/minitest_helper.rb")
require 'minitest_helper'
else
require 'test_helper'
end
end
def test
- Zeus::M.run(ARGV)
- end
- alias_method :testrb, :test # for compatibility with 0.10.x
-
- def spec_helper
- require 'spec_helper'
- end
-
- def rspec
- exit RSpec::Core::Runner.run(ARGV)
+ if defined?(RSpec)
+ exit RSpec::Core::Runner.run(ARGV)
+ else
+ Zeus::M.run(ARGV)
+ end
end
def cucumber_environment

0 comments on commit a856041

Please sign in to comment.
Something went wrong with that request. Please try again.