Skip to content

Commit bf60ea5

Browse files
committed
Rename 'get' to 'fetch' in MemoryStore tests and update block syntax for consistency; adjust sleep duration in Profiler tests to use seconds
1 parent 87c33be commit bf60ea5

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

spec/azu/cache_spec.cr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ describe Azu::Cache do
163163
stats.has_key?("memory_usage_mb").should be_true
164164
end
165165

166-
it "supports get with block syntax" do
166+
it "supports fetch with block syntax" do
167167
store = Azu::Cache::MemoryStore.new
168168

169169
# First call should execute block
170-
result = store.get("get_block_key", Time::Span.new(minutes: 5)) { "block_result" }
170+
result = store.fetch("fetch_block_key", Time::Span.new(minutes: 5)) { "block_result" }
171171
result.should eq("block_result")
172172

173173
# Second call should return cached value
174-
result = store.get("get_block_key", Time::Span.new(minutes: 5)) { "new_block_result" }
174+
result = store.fetch("fetch_block_key", Time::Span.new(minutes: 5)) { "new_block_result" }
175175
result.should eq("block_result")
176176
end
177177
end

spec/azu/development_tools_spec.cr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe Azu::DevelopmentTools do
6161

6262
it "records entry with duration" do
6363
profiler = Azu::DevelopmentTools::Profiler.new(enabled: true)
64-
profiler.profile("test") { sleep 0.01 }
64+
profiler.profile("test") { sleep 0.01.seconds }
6565
profiler.entries.first.duration.total_milliseconds.should be >= 10
6666
end
6767

@@ -152,15 +152,15 @@ describe Azu::DevelopmentTools do
152152

153153
it "calculates total time" do
154154
profiler = Azu::DevelopmentTools::Profiler.new(enabled: true)
155-
profiler.profile("test") { sleep 0.01 }
155+
profiler.profile("test") { sleep 0.01.seconds }
156156

157157
stats = profiler.stats["test"]
158158
stats["total_time_ms"].should be >= 10
159159
end
160160

161161
it "calculates average time" do
162162
profiler = Azu::DevelopmentTools::Profiler.new(enabled: true)
163-
2.times { profiler.profile("test") { sleep 0.01 } }
163+
2.times { profiler.profile("test") { sleep 0.01.seconds } }
164164

165165
stats = profiler.stats["test"]
166166
stats["avg_time_ms"].should be >= 10

0 commit comments

Comments
 (0)