Skip to content

Commit a3cf7dc

Browse files
gregbellwhatthewhat
authored andcommitted
Specs and cukes now detect the version of rails we're using
1 parent 87dd423 commit a3cf7dc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

features/support/env.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../../Gemfile', __FILE__)
88

9+
require File.expand_path('../../../spec/support/detect_rails_version', __FILE__)
10+
ENV["RAILS"] ||= detect_rails_version
11+
912
require 'rubygems'
1013
require "bundler"
1114
Bundler.setup
1215

13-
ENV["RAILS"] ||= "3.0.0"
1416
ENV["RAILS_ENV"] ||= "cucumber"
1517
ENV['RAILS_ROOT'] = File.expand_path("../../../spec/rails/rails-#{ENV["RAILS"]}", __FILE__)
1618

spec/spec_helper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
55

6+
require 'detect_rails_version'
7+
ENV['RAILS'] ||= detect_rails_version
8+
69
require "bundler"
710
Bundler.setup
811

@@ -79,9 +82,7 @@ def mock_action_view(assigns = {})
7982

8083
end
8184

82-
ENV['RAILS'] ||= '3.0.0'
8385
ENV['RAILS_ENV'] = 'test'
84-
8586
ENV['RAILS_ROOT'] = File.expand_path("../rails/rails-#{ENV["RAILS"]}", __FILE__)
8687

8788
# Create the test app if it doesn't exists

0 commit comments

Comments
 (0)