From 4b2951cfd42e67d1cfc761ae83a7e47e12a098a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 11 Apr 2018 20:46:39 +0200 Subject: [PATCH] Move Time::Location spec additions to spec_helper (#5785) These additional methods are used by a method in spec_helper and would not be available unless location_spec.cr is required --- spec/std/time/location_spec.cr | 17 ----------------- spec/std/time/spec_helper.cr | 20 ++++++++++++++++++++ spec/std/time/time_spec.cr | 1 - 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/spec/std/time/location_spec.cr b/spec/std/time/location_spec.cr index e4a9bea15190..939629014e76 100644 --- a/spec/std/time/location_spec.cr +++ b/spec/std/time/location_spec.cr @@ -1,23 +1,6 @@ -require "spec" require "./spec_helper" class Time::Location - def __cached_range - @cached_range - end - - def __cached_zone - @cached_zone - end - - def __cached_zone=(zone) - @cached_zone = zone - end - - def self.__clear_location_cache - @@location_cache.clear - end - describe Time::Location do describe ".load" do it "loads Europe/Berlin" do diff --git a/spec/std/time/spec_helper.cr b/spec/std/time/spec_helper.cr index 22b7f60cd5ef..14edb581568f 100644 --- a/spec/std/time/spec_helper.cr +++ b/spec/std/time/spec_helper.cr @@ -1,3 +1,23 @@ +require "spec" + +class Time::Location + def __cached_range + @cached_range + end + + def __cached_zone + @cached_zone + end + + def __cached_zone=(zone) + @cached_zone = zone + end + + def self.__clear_location_cache + @@location_cache.clear + end +end + def with_env(name, value) previous = ENV[name]? begin diff --git a/spec/std/time/time_spec.cr b/spec/std/time/time_spec.cr index 609689a6de5c..7b55eb5776aa 100644 --- a/spec/std/time/time_spec.cr +++ b/spec/std/time/time_spec.cr @@ -1,4 +1,3 @@ -require "spec" require "./spec_helper" def Time.expect_invalid