DEV: Apply syntax_tree formatting to spec/*

This commit is contained in:
David Taylor
2023-01-09 11:18:21 +00:00
parent 0cf6421716
commit cb932d6ee1
907 changed files with 58693 additions and 45909 deletions

View File

@ -1,9 +1,8 @@
# frozen_string_literal: true
require 'cache'
require "cache"
RSpec.describe Cache do
let :cache do
Cache.new
end
@ -43,9 +42,7 @@ RSpec.describe Cache do
it "can delete correctly" do
cache.delete("key")
cache.fetch("key", expires_in: 1.minute) do
"test"
end
cache.fetch("key", expires_in: 1.minute) { "test" }
expect(cache.fetch("key")).to eq("test")
@ -59,9 +56,7 @@ RSpec.describe Cache do
key = cache.normalize_key("key")
cache.fetch("key", expires_in: 1.minute) do
"bob"
end
cache.fetch("key", expires_in: 1.minute) { "bob" }
expect(Discourse.redis.ttl(key)).to be_within(2.seconds).of(1.minute)
@ -75,9 +70,10 @@ RSpec.describe Cache do
it "can store and fetch correctly" do
cache.delete "key"
r = cache.fetch "key" do
"bob"
end
r =
cache.fetch "key" do
"bob"
end
expect(r).to eq("bob")
end
@ -85,9 +81,10 @@ RSpec.describe Cache do
it "can fetch existing correctly" do
cache.write "key", "bill"
r = cache.fetch "key" do
"bob"
end
r =
cache.fetch "key" do
"bob"
end
expect(r).to eq("bill")
end