DEV: Prevent warnings in specs

DEV: Prevent warnings in specs

diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb
index 8628759..4fd5ab1 100644
--- a/lib/js_locale_helper.rb
+++ b/lib/js_locale_helper.rb
@@ -162,7 +162,7 @@ module JsLocaleHelper
     result
   end
 
-  MOMENT_LOCALE_MAPPING = {
+  MOMENT_LOCALE_MAPPING ||= {
     "hy" => "hy-am"
   }
 
diff --git a/spec/requests/theme_javascripts_controller_spec.rb b/spec/requests/theme_javascripts_controller_spec.rb
index ac9475c..57a415e 100644
--- a/spec/requests/theme_javascripts_controller_spec.rb
+++ b/spec/requests/theme_javascripts_controller_spec.rb
@@ -49,7 +49,9 @@ describe ThemeJavascriptsController do
     end
 
     def clear_disk_cache
-      `rm #{ThemeJavascriptsController::DISK_CACHE_PATH}/*`
+      if Dir.exist?(ThemeJavascriptsController::DISK_CACHE_PATH)
+        `rm #{ThemeJavascriptsController::DISK_CACHE_PATH}/*`
+      end
     end
   end
 end

GitHub sha: ac27bdce

2 Likes