diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-01-29 13:26:40 -0800 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-01-30 12:26:19 +1300 |
commit | 104ba0560d463001a02c68f57769306bb78593a2 (patch) | |
tree | 7c2c87094155b9ab33ebdb1be9600ef92638eefd | |
parent | 67c19ac90c5165ca596165dc926dc055d6ac5d9f (diff) | |
download | rack-104ba0560d463001a02c68f57769306bb78593a2.tar.gz |
Attempt to satisfy rubocop
-rw-r--r-- | test/spec_lint.rb | 6 | ||||
-rw-r--r-- | test/spec_request.rb | 2 | ||||
-rw-r--r-- | test/spec_server.rb | 2 | ||||
-rw-r--r-- | test/spec_session_abstract_persisted.rb | 2 | ||||
-rw-r--r-- | test/spec_session_abstract_session_hash.rb | 6 | ||||
-rw-r--r-- | test/spec_utils.rb | 6 |
6 files changed, 12 insertions, 12 deletions
diff --git a/test/spec_lint.rb b/test/spec_lint.rb index 9823a9c6..7b2151b0 100644 --- a/test/spec_lint.rb +++ b/test/spec_lint.rb @@ -283,7 +283,7 @@ describe Rack::Lint do Rack::Lint.new(lambda { |env| env['rack.input'].each{ |x| } [200, Object.new, []] - }).call(env({"rack.input" => io})) + }).call(env({ "rack.input" => io })) }.must_raise(Rack::Lint::LintError). message.must_equal "headers object should respond to #each, but doesn't (got Object as headers)" @@ -610,14 +610,14 @@ describe Rack::Lint do Rack::Lint.new(lambda { |env| env['rack.hijack'].call [201, { "Content-type" => "text/plain", "Content-length" => "0" }, []] - }).call(env({'rack.hijack?' => true, 'rack.hijack' => lambda { Object.new } })) + }).call(env({ 'rack.hijack?' => true, 'rack.hijack' => lambda { Object.new } })) }.must_raise(Rack::Lint::LintError). message.must_match(/rack.hijack_io must respond to read/) Rack::Lint.new(lambda { |env| env['rack.hijack'].call [201, { "Content-type" => "text/plain", "Content-length" => "0" }, []] - }).call(env({'rack.hijack?' => true, 'rack.hijack' => lambda { StringIO.new }, 'rack.hijack_io' => StringIO.new })). + }).call(env({ 'rack.hijack?' => true, 'rack.hijack' => lambda { StringIO.new }, 'rack.hijack_io' => StringIO.new })). first.must_equal 201 Rack::Lint.new(lambda { |env| diff --git a/test/spec_request.rb b/test/spec_request.rb index e484a577..c618373f 100644 --- a/test/spec_request.rb +++ b/test/spec_request.rb @@ -462,7 +462,7 @@ class RackRequestTest < Minitest::Spec end it "have params only return GET if POST cannot be processed" do - obj = Object.new + obj = Object.new def obj.read(*) raise EOFError end def obj.set_encoding(*) end def obj.rewind(*) end diff --git a/test/spec_server.rb b/test/spec_server.rb index dc9e7337..443c5273 100644 --- a/test/spec_server.rb +++ b/test/spec_server.rb @@ -150,7 +150,7 @@ describe Rack::Server do it "support -h option to get handler-specific help" do cgi = Rack::Handler.get('cgi') begin - def cgi.valid_options; {"FOO=BAR"=>"BAZ"} end + def cgi.valid_options; { "FOO=BAR" => "BAZ" } end test_options_server('-scgi', '-h').must_match(/\AUsage: rackup.*Ruby options:.*Rack options.*Profiling options.*Common options.*Server-specific options for Rack::Handler::CGI.*-O +FOO=BAR +BAZ.*exited\z/m) ensure cgi.singleton_class.send(:remove_method, :valid_options) diff --git a/test/spec_session_abstract_persisted.rb b/test/spec_session_abstract_persisted.rb index 061bd2f7..84ddf072 100644 --- a/test/spec_session_abstract_persisted.rb +++ b/test/spec_session_abstract_persisted.rb @@ -26,7 +26,7 @@ describe Rack::Session::Abstract::Persisted do @pers = @class.new(nil) def @pers.write_session(*) end errors = StringIO.new - env = {'rack.errors'=>errors} + env = { 'rack.errors' => errors } req = Rack::Request.new(env) store = Class.new do def load_session(req) diff --git a/test/spec_session_abstract_session_hash.rb b/test/spec_session_abstract_session_hash.rb index 08b69821..ac0b7bb3 100644 --- a/test/spec_session_abstract_session_hash.rb +++ b/test/spec_session_abstract_session_hash.rb @@ -21,7 +21,7 @@ describe Rack::Session::Abstract::SessionHash do end it ".find finds entry in request" do - assert_equal({}, @class.find(Rack::Request.new('rack.session'=>{}))) + assert_equal({}, @class.find(Rack::Request.new('rack.session' => {}))) end it ".set sets session in request" do @@ -58,7 +58,7 @@ describe Rack::Session::Abstract::SessionHash do it "#each iterates over entries" do a = [] - @hash.each do |k,v| + @hash.each do |k, v| a << [k, v] end a.must_equal [["foo", :bar], ["baz", :qux], ["x", { y: 1 }]] @@ -72,7 +72,7 @@ describe Rack::Session::Abstract::SessionHash do end it "#replace replaces hash" do - hash.replace({bar: "foo"}) + hash.replace({ bar: "foo" }) assert_equal "foo", hash["bar"] end diff --git a/test/spec_utils.rb b/test/spec_utils.rb index 890cf710..7adbe218 100644 --- a/test/spec_utils.rb +++ b/test/spec_utils.rb @@ -554,7 +554,7 @@ describe Rack::Utils, "cookies" do end it "sets and deletes cookies in header hash" do - header = {'Set-Cookie'=>''} + header = { 'Set-Cookie' => ''} Rack::Utils.set_cookie_header!(header, 'name', 'value').must_be_nil header['Set-Cookie'].must_equal 'name=value' Rack::Utils.set_cookie_header!(header, 'name2', 'value2').must_be_nil @@ -567,11 +567,11 @@ describe Rack::Utils, "cookies" do Rack::Utils.delete_cookie_header!(header, 'name').must_be_nil header['Set-Cookie'].must_equal "name2=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT\nname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" - header = {'Set-Cookie'=>nil} + header = { 'Set-Cookie' => nil } Rack::Utils.delete_cookie_header!(header, 'name').must_be_nil header['Set-Cookie'].must_equal "name=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" - header = {'Set-Cookie'=>[]} + header = { 'Set-Cookie' => [] } Rack::Utils.delete_cookie_header!(header, 'name').must_be_nil header['Set-Cookie'].must_equal "name=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" end |