Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix Rails already initialized error

Ensure RSpec and Cucumber load the same environment path. Cucumber was
loading /private/tmp, while RSpec loaded /tmp. Ruby would attempt to
load two separate paths which resolved to the same instance of Rails.
  • Loading branch information...
commit e973afa08d28cd56e3cde81c05e76716e34ccc9c 1 parent 37909b4
@sandro authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/specjour/manager.rb
  2. +1 −1  lib/specjour/rspec/preloader.rb
View
2  lib/specjour/manager.rb
@@ -95,7 +95,7 @@ def pid
end
def project_path
- File.join("/tmp", project_name)
+ File.expand_path(project_name, File.realpath('/tmp'))
end
def start
View
2  lib/specjour/rspec/preloader.rb
@@ -1,7 +1,7 @@
class Specjour::RSpec::Preloader
def self.load(paths=[])
Specjour.benchmark("Loading RSpec environment") do
- require './spec/spec_helper'
+ require File.expand_path('spec/spec_helper', Dir.pwd)
load_spec_files paths
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.