From 1f65a70f1dbba0f6e294ee820dfd1e957c46572d Mon Sep 17 00:00:00 2001 From: Sebastian Rachner Date: Thu, 5 Nov 2020 12:44:32 +0100 Subject: [PATCH] Fix setting editor with symbol --- lib/better_errors.rb | 2 +- spec/better_errors_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/better_errors.rb b/lib/better_errors.rb index af46bdd5..346a1b1d 100644 --- a/lib/better_errors.rb +++ b/lib/better_errors.rb @@ -106,7 +106,7 @@ def self.editor # def self.editor=(editor) if editor.is_a? Symbol - @editor = Editor.for_symbol(editor) + @editor = Editor.editor_from_symbol(editor) raise(ArgumentError, "Symbol #{editor} is not a symbol in the list of supported errors.") unless editor elsif editor.is_a? String @editor = Editor.for_formatting_string(editor) diff --git a/spec/better_errors_spec.rb b/spec/better_errors_spec.rb index fbec6e7c..10597158 100644 --- a/spec/better_errors_spec.rb +++ b/spec/better_errors_spec.rb @@ -4,7 +4,7 @@ describe ".editor" do context "when set to a specific value" do before do - allow(BetterErrors::Editor).to receive(:for_symbol).and_return(:editor_from_symbol) + allow(BetterErrors::Editor).to receive(:editor_from_symbol).and_return(:editor_from_symbol) allow(BetterErrors::Editor).to receive(:for_formatting_string).and_return(:editor_from_formatting_string) allow(BetterErrors::Editor).to receive(:for_proc).and_return(:editor_from_proc) end @@ -27,9 +27,9 @@ end context "when the value is a symbol" do - it "uses BetterErrors::Editor.for_symbol to set the value" do + it "uses BetterErrors::Editor.editor_from_symbol to set the value" do subject.editor = :subl - expect(BetterErrors::Editor).to have_received(:for_symbol).with(:subl) + expect(BetterErrors::Editor).to have_received(:editor_from_symbol).with(:subl) expect(subject.editor).to eq(:editor_from_symbol) end end