]> source.dussan.org Git - redmine.git/commitdiff
cleanup: rubocop: fix Layout/IndentFirstArgument in test/unit/changeset_test.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 23 Nov 2019 15:11:51 +0000 (15:11 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 23 Nov 2019 15:11:51 +0000 (15:11 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19216 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/changeset_test.rb

index 74c001cdbe6bdfb2bacaaec2b580de037220245b..e116882e7a4c52bbf3b4d40918bcfbb09e42c856 100644 (file)
@@ -296,9 +296,11 @@ class ChangesetTest < ActiveSupport::TestCase
 
   def test_commit_referencing_a_parent_project_issue
     # repository of child project
-    r = Repository::Subversion.create!(
-          :project => Project.find(3),
-          :url     => 'svn://localhost/test')
+    r = Repository::Subversion.
+         create!(
+           :project => Project.find(3),
+           :url     => 'svn://localhost/test'
+         )
     c = Changeset.new(:repository   => r,
                       :committed_on => Time.now,
                       :comments     => 'refs #2, an issue of a parent project',
@@ -309,9 +311,11 @@ class ChangesetTest < ActiveSupport::TestCase
   end
 
   def test_commit_referencing_a_project_with_commit_cross_project_ref_disabled
-    r = Repository::Subversion.create!(
-          :project => Project.find(3),
-          :url     => 'svn://localhost/test')
+    r = Repository::Subversion.
+          create!(
+            :project => Project.find(3),
+            :url     => 'svn://localhost/test'
+          )
     with_settings :commit_cross_project_ref => '0' do
       c = Changeset.new(:repository   => r,
                         :committed_on => Time.now,
@@ -323,9 +327,11 @@ class ChangesetTest < ActiveSupport::TestCase
   end
 
   def test_commit_referencing_a_project_with_commit_cross_project_ref_enabled
-    r = Repository::Subversion.create!(
-          :project => Project.find(3),
-          :url     => 'svn://localhost/test')
+    r = Repository::Subversion.
+          create!(
+            :project => Project.find(3),
+            :url     => 'svn://localhost/test'
+          )
     with_settings :commit_cross_project_ref => '1' do
       c = Changeset.new(:repository   => r,
                         :committed_on => Time.now,
@@ -385,19 +391,23 @@ class ChangesetTest < ActiveSupport::TestCase
   end
 
   def test_text_tag_revision_with_repository_identifier
-    r = Repository::Subversion.create!(
-          :project_id => 1,
-          :url     => 'svn://localhost/test',
-          :identifier => 'documents')
+    r = Repository::Subversion.
+         create!(
+           :project_id => 1,
+           :url     => 'svn://localhost/test',
+           :identifier => 'documents'
+         )
     c = Changeset.new(:revision => '520', :repository => r)
     assert_equal 'documents|r520', c.text_tag
     assert_equal 'ecookbook:documents|r520', c.text_tag(Project.find(2))
   end
 
   def test_text_tag_hash
-    c = Changeset.new(
-          :scmid    => '7234cb2750b63f47bff735edc50a1c0a433c2518',
-          :revision => '7234cb2750b63f47bff735edc50a1c0a433c2518')
+    c = Changeset.
+          new(
+            :scmid    => '7234cb2750b63f47bff735edc50a1c0a433c2518',
+            :revision => '7234cb2750b63f47bff735edc50a1c0a433c2518'
+          )
     assert_equal 'commit:7234cb2750b63f47bff735edc50a1c0a433c2518', c.text_tag
   end
 
@@ -417,10 +427,13 @@ class ChangesetTest < ActiveSupport::TestCase
   end
 
   def test_text_tag_hash_with_repository_identifier
-    r = Repository::Subversion.new(
+    r =
+      Repository::Subversion.
+        new(
           :project_id => 1,
           :url     => 'svn://localhost/test',
-          :identifier => 'documents')
+          :identifier => 'documents'
+        )
     c = Changeset.new(:revision => '7234cb27', :scmid => '7234cb27', :repository => r)
     assert_equal 'commit:documents|7234cb27', c.text_tag
     assert_equal 'ecookbook:commit:documents|7234cb27', c.text_tag(Project.find(2))
@@ -449,10 +462,12 @@ class ChangesetTest < ActiveSupport::TestCase
   def test_comments_should_be_converted_to_utf8
     proj = Project.find(3)
     str = "Texte encod\xe9 en ISO-8859-1.".b
-    r = Repository::Bazaar.create!(
+    r = Repository::Bazaar.
+          create!(
             :project      => proj,
             :url          => '/tmp/test/bazaar',
-            :log_encoding => 'ISO-8859-1' )
+            :log_encoding => 'ISO-8859-1'
+          )
     assert r
     c = Changeset.new(:repository   => r,
                       :committed_on => Time.now,
@@ -466,10 +481,12 @@ class ChangesetTest < ActiveSupport::TestCase
   def test_invalid_utf8_sequences_in_comments_should_be_replaced_latin1
     proj = Project.find(3)
     str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".b
-    r = Repository::Bazaar.create!(
+    r = Repository::Bazaar.
+          create!(
             :project      => proj,
             :url          => '/tmp/test/bazaar',
-            :log_encoding => 'UTF-8' )
+            :log_encoding => 'UTF-8'
+          )
     assert r
     c = Changeset.new(:repository   => r,
                       :committed_on => Time.now,
@@ -485,10 +502,12 @@ class ChangesetTest < ActiveSupport::TestCase
   def test_invalid_utf8_sequences_in_comments_should_be_replaced_ja_jis
     proj = Project.find(3)
     str = "test\xb5\xfetest\xb5\xfe".b
-    r = Repository::Bazaar.create!(
+    r = Repository::Bazaar.
+          create!(
             :project      => proj,
             :url          => '/tmp/test/bazaar',
-            :log_encoding => 'ISO-2022-JP' )
+            :log_encoding => 'ISO-2022-JP'
+          )
     assert r
     c = Changeset.new(:repository   => r,
                       :committed_on => Time.now,
@@ -510,10 +529,12 @@ class ChangesetTest < ActiveSupport::TestCase
     s4.force_encoding('UTF-8')
     assert_equal s3.encode('UTF-8'), s4
     proj = Project.find(3)
-    r = Repository::Bazaar.create!(
+    r = Repository::Bazaar.
+          create!(
             :project      => proj,
             :url          => '/tmp/test/bazaar',
-            :log_encoding => 'ISO-8859-1' )
+            :log_encoding => 'ISO-8859-1'
+          )
     assert r
     c = Changeset.new(:repository   => r,
                       :committed_on => Time.now,
@@ -527,24 +548,30 @@ class ChangesetTest < ActiveSupport::TestCase
   def test_invalid_utf8_sequences_in_paths_should_be_replaced
     proj = Project.find(3)
     str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".b
-    r = Repository::Bazaar.create!(
+    r = Repository::Bazaar.
+          create!(
             :project => proj,
             :url => '/tmp/test/bazaar',
-            :log_encoding => 'UTF-8' )
+            :log_encoding => 'UTF-8'
+          )
     assert r
-    cs = Changeset.new(
-               :repository   => r,
-               :committed_on => Time.now,
-               :revision     => '123',
-               :scmid        => '12345',
-               :comments     => "test")
+    cs = Changeset.
+           new(
+             :repository   => r,
+             :committed_on => Time.now,
+             :revision     => '123',
+             :scmid        => '12345',
+             :comments     => "test"
+           )
     assert(cs.save)
-    ch = Change.new(
-                  :changeset     => cs,
-                  :action        => "A",
-                  :path          => "Texte encod\xE9 en ISO-8859-1",
-                  :from_path     => str2,
-                  :from_revision => "345")
+    ch = Change.
+           new(
+             :changeset     => cs,
+             :action        => "A",
+             :path          => "Texte encod\xE9 en ISO-8859-1",
+             :from_path     => str2,
+             :from_revision => "345"
+           )
     assert(ch.save)
     assert_equal "Texte encod? en ISO-8859-1", ch.path
     assert_equal "?a?b?c?d?e test", ch.from_path
@@ -552,10 +579,12 @@ class ChangesetTest < ActiveSupport::TestCase
 
   def test_comments_nil
     proj = Project.find(3)
-    r = Repository::Bazaar.create!(
+    r = Repository::Bazaar.
+          create!(
             :project      => proj,
             :url          => '/tmp/test/bazaar',
-            :log_encoding => 'ISO-8859-1' )
+            :log_encoding => 'ISO-8859-1'
+          )
     assert r
     c = Changeset.new(:repository   => r,
                       :committed_on => Time.now,
@@ -571,10 +600,12 @@ class ChangesetTest < ActiveSupport::TestCase
 
   def test_comments_empty
     proj = Project.find(3)
-    r = Repository::Bazaar.create!(
+    r = Repository::Bazaar.
+          create!(
             :project      => proj,
             :url          => '/tmp/test/bazaar',
-            :log_encoding => 'ISO-8859-1' )
+            :log_encoding => 'ISO-8859-1'
+          )
     assert r
     c = Changeset.new(:repository   => r,
                       :committed_on => Time.now,