spec/spec_helper.rb in gorillib-0.0.8 vs spec/spec_helper.rb in gorillib-0.1.0
- old
+ new
@@ -1,17 +1,22 @@
require 'rubygems' unless defined?(Gem)
require 'spork'
require 'rspec'
-Spork.prefork do
- # You'll need to restart for changes to configuration or code from libraries loaded here
+GORILLIB_ROOT_DIR = File.expand_path(File.join(File.dirname(__FILE__),'..'))
+def GORILLIB_ROOT_DIR *paths
+ File.join(::GORILLIB_ROOT_DIR, *paths)
+end
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
+Spork.prefork do # Must restart for changes to config / code from libraries loaded here
+ $LOAD_PATH.unshift(GORILLIB_ROOT_DIR('lib'))
+ $LOAD_PATH.unshift(GORILLIB_ROOT_DIR('spec/support'))
+ Dir[GORILLIB_ROOT_DIR('spec/support/matchers/*.rb')].each {|f| require f}
RSpec.configure do |config|
end
end
-Spork.each_run do
- # This code will be run each time you run your specs.
+Spork.each_run do # This code will be run each time you run your specs.
+ RSpec.configure do |config|
+ end
end