Skip to content

Commit 03414a7

Browse files
committed
re-arrange test helpers / stubs
1 parent 9ba2f53 commit 03414a7

File tree

17 files changed

+33
-60
lines changed

17 files changed

+33
-60
lines changed

src/spec/ruby/jruby/rack/rails_booter_spec.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class ::CGI::Session::PStore; end
148148
it "should set the PUBLIC_ROOT constant to the location of the public root",
149149
:lib => [ :rails23, :stub ] do
150150

151-
booter.app_path = File.expand_path("../../../rails", __FILE__)
151+
booter.app_path = File.expand_path("../../../rails23", __FILE__)
152152
booter.boot!
153153
expect( PUBLIC_ROOT ).to eql booter.public_path
154154
end
@@ -162,7 +162,7 @@ class ::CGI::Session::PStore; end
162162
before :each do
163163
$servlet_context = @servlet_context
164164
@rack_context.should_receive(:getContextPath).and_return "/foo"
165-
booter.app_path = File.expand_path("../../../rails", __FILE__)
165+
booter.app_path = File.expand_path("../../../rails23", __FILE__)
166166
booter.boot!
167167
silence_warnings { booter.load_environment }
168168
end
@@ -202,7 +202,7 @@ class ::CGI::Session::PStore; end
202202

203203
before :each do
204204
$servlet_context = @servlet_context
205-
booter.app_path = File.expand_path("../../../rails3", __FILE__)
205+
booter.app_path = File.expand_path("../../../rails3x", __FILE__)
206206
booter.boot!
207207
silence_warnings { booter.load_environment }
208208
end
@@ -217,7 +217,9 @@ class ::CGI::Session::PStore; end
217217

218218
it "should set the application configuration's public path" do
219219
paths = {}
220-
%w( public public/javascripts public/stylesheets ).each { |p| paths[p] = [p] }
220+
for p in %w( public public/javascripts public/stylesheets )
221+
paths[p] = [p]
222+
end
221223
app = double("app"); app.stub_chain(:config, :paths).and_return(paths)
222224
public_path = Pathname.new(booter.public_path)
223225

@@ -331,7 +333,7 @@ def log_initializer
331333

332334
before :each do
333335
$servlet_context = @servlet_context
334-
booter.app_path = File.expand_path("../../../rails3", __FILE__)
336+
booter.app_path = File.expand_path("../../../rails3x", __FILE__)
335337
booter.boot!
336338
booter.load_environment
337339
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# This is a fake Rails config/boot file to be used during testing.
23

34
RAILS_ROOT = "#{ENV['RAILS_ROOT']}"

src/spec/ruby/rails/config/environment.rb renamed to src/spec/ruby/rails23/config/environment.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
#--
2-
# Copyright (c) 2010-2012 Engine Yard, Inc.
3-
# Copyright (c) 2007-2009 Sun Microsystems, Inc.
4-
# This source code is available under the MIT license.
5-
# See the file LICENSE.txt for details.
6-
#++
71

82
# This is a fake Rails config/environment file to be used during testing.
93

104
# Specifies gem version of Rails to use when vendor/rails is not present
11-
RAILS_GEM_VERSION = '2.3.14' # unless defined? RAILS_GEM_VERSION
5+
RAILS_GEM_VERSION = '2.3.18' # unless defined? RAILS_GEM_VERSION
126

137
# Bootstrap the Rails environment, frameworks, and default configuration
148
require File.join(File.dirname(__FILE__), 'boot')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)