Skip to content

Commit

Permalink
Move Time::Location spec additions to spec_helper (#5785)
Browse files Browse the repository at this point in the history
These additional methods are used by a method in spec_helper and would not be available unless location_spec.cr is required
  • Loading branch information
straight-shoota authored and RX14 committed Apr 11, 2018
1 parent 8dd6f54 commit 4b2951c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
17 changes: 0 additions & 17 deletions spec/std/time/location_spec.cr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 20 additions & 0 deletions spec/std/time/spec_helper.cr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion spec/std/time/time_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "spec"
require "./spec_helper"

def Time.expect_invalid
Expand Down

0 comments on commit 4b2951c

Please sign in to comment.