diff options
author | Anatolii Didukh <railsme@users.noreply.github.com> | 2019-10-16 09:32:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-16 09:32:13 +0300 |
commit | 13f444a78998e8fd7b1de37495dba6beba93efd7 (patch) | |
tree | fd4f1ae4f4296ce9553dc610de7520e77e25191a /test/spec_runtime.rb | |
parent | ba67b778d54b7213c0e7f1a9073885fe5117aeb2 (diff) | |
parent | fb2668fec7b9ba2bfdabf72bfc4c8c53518c9abb (diff) | |
download | rack-13f444a78998e8fd7b1de37495dba6beba93efd7.tar.gz |
Merge branch 'master' into optimize-static
Diffstat (limited to 'test/spec_runtime.rb')
-rw-r--r-- | test/spec_runtime.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/spec_runtime.rb b/test/spec_runtime.rb index f7f52ad9..10e561de 100644 --- a/test/spec_runtime.rb +++ b/test/spec_runtime.rb @@ -1,4 +1,6 @@ -require 'minitest/autorun' +# frozen_string_literal: true + +require 'minitest/global_expectations/autorun' require 'rack/lint' require 'rack/mock' require 'rack/runtime' @@ -13,25 +15,25 @@ describe Rack::Runtime do end it "sets X-Runtime is none is set" do - app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, "Hello, World!"] } + app = lambda { |env| [200, { 'Content-Type' => 'text/plain' }, "Hello, World!"] } response = runtime_app(app).call(request) response[1]['X-Runtime'].must_match(/[\d\.]+/) end it "doesn't set the X-Runtime if it is already set" do - app = lambda { |env| [200, {'Content-Type' => 'text/plain', "X-Runtime" => "foobar"}, "Hello, World!"] } + app = lambda { |env| [200, { 'Content-Type' => 'text/plain', "X-Runtime" => "foobar" }, "Hello, World!"] } response = runtime_app(app).call(request) response[1]['X-Runtime'].must_equal "foobar" end it "allow a suffix to be set" do - app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, "Hello, World!"] } + app = lambda { |env| [200, { 'Content-Type' => 'text/plain' }, "Hello, World!"] } response = runtime_app(app, "Test").call(request) response[1]['X-Runtime-Test'].must_match(/[\d\.]+/) end it "allow multiple timers to be set" do - app = lambda { |env| sleep 0.1; [200, {'Content-Type' => 'text/plain'}, "Hello, World!"] } + app = lambda { |env| sleep 0.1; [200, { 'Content-Type' => 'text/plain' }, "Hello, World!"] } runtime = runtime_app(app, "App") # wrap many times to guarantee a measurable difference |