Skip to content

Commit 1f65a70

Browse files
committed
Fix setting editor with symbol
1 parent afc1e3e commit 1f65a70

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/better_errors.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def self.editor
106106
#
107107
def self.editor=(editor)
108108
if editor.is_a? Symbol
109-
@editor = Editor.for_symbol(editor)
109+
@editor = Editor.editor_from_symbol(editor)
110110
raise(ArgumentError, "Symbol #{editor} is not a symbol in the list of supported errors.") unless editor
111111
elsif editor.is_a? String
112112
@editor = Editor.for_formatting_string(editor)

spec/better_errors_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe ".editor" do
55
context "when set to a specific value" do
66
before do
7-
allow(BetterErrors::Editor).to receive(:for_symbol).and_return(:editor_from_symbol)
7+
allow(BetterErrors::Editor).to receive(:editor_from_symbol).and_return(:editor_from_symbol)
88
allow(BetterErrors::Editor).to receive(:for_formatting_string).and_return(:editor_from_formatting_string)
99
allow(BetterErrors::Editor).to receive(:for_proc).and_return(:editor_from_proc)
1010
end
@@ -27,9 +27,9 @@
2727
end
2828

2929
context "when the value is a symbol" do
30-
it "uses BetterErrors::Editor.for_symbol to set the value" do
30+
it "uses BetterErrors::Editor.editor_from_symbol to set the value" do
3131
subject.editor = :subl
32-
expect(BetterErrors::Editor).to have_received(:for_symbol).with(:subl)
32+
expect(BetterErrors::Editor).to have_received(:editor_from_symbol).with(:subl)
3333
expect(subject.editor).to eq(:editor_from_symbol)
3434
end
3535
end

0 commit comments

Comments
 (0)