Browse Source

Corrected with rubocop cop 'Style/GuardClause'.

Thorsten Eckel 10 years ago
parent
commit
09c3d244f0
1 changed files with 6 additions and 6 deletions
  1. 6 6
      test/test_helper.rb

+ 6 - 6
test/test_helper.rb

@@ -45,12 +45,12 @@ class ActiveSupport::TestCase
     puts 'teardown'
 
     # check if jobs are proccessed
-    if !Delayed::Job.all.empty?
-      Delayed::Job.where('failed_at != NULL').each {|job|
-        assert( false, "not processable job #{jobs.inspect}" )
-      }
-      Delayed::Job.all.destroy_all
-    end
+    return if Delayed::Job.all.empty?
+
+    Delayed::Job.where('failed_at != NULL').each {|job|
+      assert( false, "not processable job #{jobs.inspect}" )
+    }
+    Delayed::Job.all.destroy_all
   end
 
   # Add more helper methods to be used by all tests here...