Sha256: ea38789e17a8455258e3a73914ec28b2f34f5191dedac330adcc00cd0fb3af01
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
# frozen_string_literal: true # This file is part of Alexandria. # # See the file README.md for authorship and licensing information. require_relative "../spec_helper" describe Alexandria::Preferences do let(:instance) { described_class.instance } describe "#get_variable" do it "returns nil fetching unknown setting" do expect(instance.get_variable("does_not_exist")).to be_nil end it "allows fetching by string" do instance.toolbar_visible = false expect(instance.get_variable("toolbar_visible")).to be false end it "allows fetching by symbol" do instance.toolbar_visible = true expect(instance.get_variable(:toolbar_visible)).to be true end end describe "#set_variable" do it "allows setting by string" do instance.toolbar_visible = false instance.set_variable("toolbar_visible", true) expect(instance.toolbar_visible).to be true end it "allows setting by symbol" do instance.toolbar_visible = false instance.set_variable(:toolbar_visible, true) expect(instance.toolbar_visible).to be true end end it "allows setting known setting to false" do instance.toolbar_visible = false expect(instance.toolbar_visible).to be false end it "resets known setting by setting to nil" do instance.toolbar_visible = nil expect(instance.toolbar_visible).to be true end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
alexandria-book-collection-manager-0.7.10 | spec/alexandria/preferences_spec.rb |