Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Time::Location spec additions to spec_helper #5785

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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