Skip to content

Commit

Permalink
Clear Time::Location cache before .load_android specs (crystal-la…
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil authored and Blacksmoke16 committed Dec 11, 2023
1 parent 47c32c0 commit 1ac464d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/std/time/location_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class Time::Location

describe ".load_android" do
it "loads Europe/Berlin" do
Location.__clear_location_cache
location = Location.load_android("Europe/Berlin", {datapath("android_tzdata")}).should_not be_nil

location.name.should eq "Europe/Berlin"
Expand All @@ -187,6 +188,7 @@ class Time::Location

it "loads new data if tzdata file was changed" do
tzdata_path = datapath("android_tzdata")
Location.__clear_location_cache
location1 = Location.load_android("Europe/Berlin", {tzdata_path})
File.touch(tzdata_path)
location2 = Location.load_android("Europe/Berlin", {tzdata_path})
Expand Down

0 comments on commit 1ac464d

Please sign in to comment.