Skip to content

Commit 6298803

Browse files
committed
[tests] Test bundler rack installs with supported Rack version
It's confusing here to test with a non-compatible version
1 parent 19c26c6 commit 6298803

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/main/java/org/jruby/rack/DefaultRackApplicationFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public void initRuntime(final Ruby runtime) {
367367
/**
368368
* Checks and sets the required Rack version (if specified as a magic comment).
369369
*
370-
* e.g. # rack.version: =1.3.6
370+
* e.g. # rack.version: =2.2.0
371371
*
372372
* @apiNote Internal API, only visible due tests.
373373
*

src/spec/ruby/rack/application_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def newRuntime()
314314
end
315315

316316
it "loads specified version of rack via bundler", :lib => :stub do
317-
gem_install_unless_installed 'rack', '1.3.6'
317+
gem_install_unless_installed 'rack', '2.2.0'
318318
set_config 'jruby.runtime.env', 'false'
319319

320320
script = "# encoding: UTF-8\n" +
@@ -324,7 +324,7 @@ def newRuntime()
324324
@runtime = app_factory.newRuntime
325325

326326
file = Tempfile.new('Gemfile')
327-
file << "source 'https://rubygems.org'\n gem 'rack', '1.3.6'"
327+
file << "source 'https://rubygems.org'\n gem 'rack', '2.2.0'"
328328
file.flush
329329
@runtime.evalScriptlet "ENV['BUNDLE_GEMFILE'] = #{file.path.inspect}"
330330
@runtime.evalScriptlet "ENV['GEM_HOME'] = #{ENV['GEM_HOME'].inspect}"
@@ -334,8 +334,8 @@ def newRuntime()
334334
@runtime.evalScriptlet "require 'rack'"
335335

336336
should_not_eval_as_nil "defined?(Bundler)"
337-
should_eval_as_eql_to "Rack.release if defined? Rack.release", '1.3'
338-
should_eval_as_eql_to "Gem.loaded_specs['rack'].version.to_s", '1.3.6'
337+
should_eval_as_eql_to "Rack.release", '2.2.0'
338+
should_eval_as_eql_to "Gem.loaded_specs['rack'].version.to_s", '2.2.0'
339339
end
340340

341341
it "initializes the $servlet_context global variable" do

src/spec/ruby/rack/util_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
it "reads magic comment 2" do
3232
code = "# encoding: UTF-8 \n" +
3333
"# comment\n" +
34-
"# rack.version: 1.3.6 \n" +
34+
"# rack.version: 2.2.0 \n" +
3535
"exit(0)\n'42'"
3636
string = IOHelpers.rubyMagicCommentValue(code, "rack.version:")
37-
expect(string).to eql "1.3.6"
37+
expect(string).to eql "2.2.0"
3838
end
3939

4040
it "works when reading an empty/null string" do

0 commit comments

Comments
 (0)