From 8b8c0700fc9a890137021efc50b70cb5376471d4 Mon Sep 17 00:00:00 2001 From: Brad Schrag Date: Thu, 13 Feb 2025 10:59:34 -0700 Subject: [PATCH 1/2] make a broken test --- test/config_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/config_test.rb diff --git a/test/config_test.rb b/test/config_test.rb new file mode 100644 index 0000000..4a3a992 --- /dev/null +++ b/test/config_test.rb @@ -0,0 +1,11 @@ +require "test_helper" + +class ConfigTest < ActiveSupport::TestCase + test "false values will replace the config values" do + original = Console1984.incinerate + Console1984.config.set_from({incinerate: false}) + refute Console1984.incinerate + ensure + Console1984.config.incinerate = original + end +end From 3cb2df9e826c8f61fad1e23689753200dadbbf6a Mon Sep 17 00:00:00 2001 From: Brad Schrag Date: Thu, 13 Feb 2025 11:07:58 -0700 Subject: [PATCH 2/2] fix the test --- lib/console1984/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/console1984/config.rb b/lib/console1984/config.rb index a744171..f9936d1 100644 --- a/lib/console1984/config.rb +++ b/lib/console1984/config.rb @@ -24,7 +24,7 @@ def initialize def set_from(properties) properties.each do |key, value| - public_send("#{key}=", value) if value.present? + public_send("#{key}=", value) end end