░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/gems/dynamic_settings/spec/dynamic_settings
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: fallback_proxy_spec.rb
# frozen_string_literal: true # Copyright (C) 2021 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. require "spec_helper" module DynamicSettings RSpec.describe FallbackProxy do let(:fallback_data) do { foo: "bar", baz: { qux: 42 } } end let(:proxy) { FallbackProxy.new(fallback_data) } describe "#initalize" do it "must store an empty hash when initialized with nil" do proxy = FallbackProxy.new(nil) expect(proxy.data).to eq({}) end end describe "#fetch(key, ttl: nil)" do it "must return the value from the data hash" do expect(proxy.fetch("foo")).to eq "bar" end it "must return nil when the val" do expect(proxy.fetch("nx-key")).to be_nil end end describe "#for_prefix(key, default_ttl: nil)" do it "must return a new instance populated with the sub hash found at the specified key" do new_proxy = proxy.for_prefix("baz") expect(new_proxy.data).to eq({ qux: 42 }.with_indifferent_access) end end describe "#set_keys" do it "merges in a hash" do kvs = { foo1: "bar1", foo2: "bar2" } proxy.set_keys(kvs) expect(proxy.data).to include kvs end end end end
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 circuit_breaker_spec.rb
RB
1.2 KB
2023-09-24 03:36
EDIT
📄 fallback_proxy_spec.rb
RB
1.9 KB
2023-09-24 03:36
EDIT
📄 memory_cache_spec.rb
RB
1.1 KB
2023-09-24 03:36
EDIT
📄 prefix_proxy_spec.rb
RB
11.3 KB
2023-09-24 03:39
EDIT