From 35b3de8021e68649cac963bd82a74cc75d1f60f0 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 6 Aug 2016 18:54:50 +0200 Subject: applies new string literal convention in actionpack/test The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default. --- actionpack/test/dispatch/uploaded_file_test.rb | 44 +++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'actionpack/test/dispatch/uploaded_file_test.rb') diff --git a/actionpack/test/dispatch/uploaded_file_test.rb b/actionpack/test/dispatch/uploaded_file_test.rb index 55ebbd5143..63d8cda9a0 100644 --- a/actionpack/test/dispatch/uploaded_file_test.rb +++ b/actionpack/test/dispatch/uploaded_file_test.rb @@ -1,4 +1,4 @@ -require 'abstract_unit' +require "abstract_unit" module ActionDispatch class UploadedFileTest < ActiveSupport::TestCase @@ -9,34 +9,34 @@ module ActionDispatch end def test_original_filename - uf = Http::UploadedFile.new(:filename => 'foo', :tempfile => Object.new) - assert_equal 'foo', uf.original_filename + uf = Http::UploadedFile.new(:filename => "foo", :tempfile => Object.new) + assert_equal "foo", uf.original_filename end def test_filename_should_be_in_utf_8 - uf = Http::UploadedFile.new(:filename => 'foo', :tempfile => Object.new) + uf = Http::UploadedFile.new(:filename => "foo", :tempfile => Object.new) assert_equal "UTF-8", uf.original_filename.encoding.to_s end def test_filename_should_always_be_in_utf_8 - uf = Http::UploadedFile.new(:filename => 'foo'.encode(Encoding::SHIFT_JIS), + uf = Http::UploadedFile.new(:filename => "foo".encode(Encoding::SHIFT_JIS), :tempfile => Object.new) assert_equal "UTF-8", uf.original_filename.encoding.to_s end def test_content_type - uf = Http::UploadedFile.new(:type => 'foo', :tempfile => Object.new) - assert_equal 'foo', uf.content_type + uf = Http::UploadedFile.new(:type => "foo", :tempfile => Object.new) + assert_equal "foo", uf.content_type end def test_headers - uf = Http::UploadedFile.new(:head => 'foo', :tempfile => Object.new) - assert_equal 'foo', uf.headers + uf = Http::UploadedFile.new(:head => "foo", :tempfile => Object.new) + assert_equal "foo", uf.headers end def test_tempfile - uf = Http::UploadedFile.new(:tempfile => 'foo') - assert_equal 'foo', uf.tempfile + uf = Http::UploadedFile.new(:tempfile => "foo") + assert_equal "foo", uf.tempfile end def test_to_io_returns_the_tempfile @@ -46,33 +46,33 @@ module ActionDispatch end def test_delegates_path_to_tempfile - tf = Class.new { def path; 'thunderhorse' end } + tf = Class.new { def path; "thunderhorse" end } uf = Http::UploadedFile.new(:tempfile => tf.new) - assert_equal 'thunderhorse', uf.path + assert_equal "thunderhorse", uf.path end def test_delegates_open_to_tempfile - tf = Class.new { def open; 'thunderhorse' end } + tf = Class.new { def open; "thunderhorse" end } uf = Http::UploadedFile.new(:tempfile => tf.new) - assert_equal 'thunderhorse', uf.open + assert_equal "thunderhorse", uf.open end def test_delegates_close_to_tempfile - tf = Class.new { def close(unlink_now=false); 'thunderhorse' end } + tf = Class.new { def close(unlink_now=false); "thunderhorse" end } uf = Http::UploadedFile.new(:tempfile => tf.new) - assert_equal 'thunderhorse', uf.close + assert_equal "thunderhorse", uf.close end def test_close_accepts_parameter tf = Class.new { def close(unlink_now=false); "thunderhorse: #{unlink_now}" end } uf = Http::UploadedFile.new(:tempfile => tf.new) - assert_equal 'thunderhorse: true', uf.close(true) + assert_equal "thunderhorse: true", uf.close(true) end def test_delegates_read_to_tempfile - tf = Class.new { def read(length=nil, buffer=nil); 'thunderhorse' end } + tf = Class.new { def read(length=nil, buffer=nil); "thunderhorse" end } uf = Http::UploadedFile.new(:tempfile => tf.new) - assert_equal 'thunderhorse', uf.read + assert_equal "thunderhorse", uf.read end def test_delegates_read_to_tempfile_with_params @@ -98,8 +98,8 @@ module ActionDispatch def test_respond_to? tf = Class.new { def read; yield end } uf = Http::UploadedFile.new(:tempfile => tf.new) - assert uf.respond_to?(:headers), 'responds to headers' - assert uf.respond_to?(:read), 'responds to read' + assert uf.respond_to?(:headers), "responds to headers" + assert uf.respond_to?(:read), "responds to read" end end end -- cgit v1.2.3