|
15 | 15 | end |
16 | 16 | end |
17 | 17 |
|
18 | | - describe ".for_symbol" do |
19 | | - subject { described_class.for_symbol(symbol) } |
20 | | - |
21 | | - [:atom].each do |symbol| |
22 | | - context "when symbol is '#{symbol}'" do |
23 | | - let(:symbol) { symbol } |
24 | | - |
25 | | - it "uses atom:// scheme" do |
26 | | - expect(subject.url("file", 42)).to start_with("atom://") |
27 | | - end |
28 | | - end |
29 | | - end |
30 | | - |
31 | | - [:emacs, :emacsclient].each do |symbol| |
32 | | - context "when symbol is '#{symbol}'" do |
33 | | - let(:symbol) { symbol } |
34 | | - it "uses emacs:// scheme" do |
35 | | - expect(subject.url("file", 42)).to start_with("emacs://") |
36 | | - end |
37 | | - end |
38 | | - end |
39 | | - |
40 | | - [:macvim, :mvim].each do |symbol| |
41 | | - context "when symbol is '#{symbol}'" do |
42 | | - let(:symbol) { symbol } |
43 | | - |
44 | | - it "uses mvim:// scheme" do |
45 | | - expect(subject.url("file", 42)).to start_with("mvim://") |
46 | | - end |
47 | | - end |
48 | | - end |
49 | | - |
50 | | - [:sublime, :subl, :st].each do |symbol| |
51 | | - context "when symbol is '#{symbol}'" do |
52 | | - let(:symbol) { symbol } |
53 | | - |
54 | | - it "uses subl:// scheme" do |
55 | | - expect(subject.url("file", 42)).to start_with("subl://") |
56 | | - end |
57 | | - end |
58 | | - end |
59 | | - |
60 | | - [:textmate, :txmt, :tm].each do |symbol| |
61 | | - context "when symbol is '#{symbol}'" do |
62 | | - let(:symbol) { symbol } |
63 | | - |
64 | | - it "uses txmt:// scheme" do |
65 | | - expect(subject.url("file", 42)).to start_with("txmt://") |
66 | | - end |
67 | | - end |
68 | | - end |
69 | | - end |
70 | | - |
71 | 18 | describe ".default_editor" do |
72 | 19 | subject(:default_editor) { described_class.default_editor } |
73 | 20 | before do |
|
230 | 177 | end |
231 | 178 | end |
232 | 179 | end |
| 180 | + |
| 181 | + describe ".editor_from_symbol" do |
| 182 | + subject { described_class.editor_from_symbol(symbol) } |
| 183 | + |
| 184 | + [:atom].each do |symbol| |
| 185 | + context "when symbol is '#{symbol}'" do |
| 186 | + let(:symbol) { symbol } |
| 187 | + |
| 188 | + it "uses atom:// scheme" do |
| 189 | + expect(subject.url("file", 42)).to start_with("atom://") |
| 190 | + end |
| 191 | + end |
| 192 | + end |
| 193 | + |
| 194 | + [:emacs, :emacsclient].each do |symbol| |
| 195 | + context "when symbol is '#{symbol}'" do |
| 196 | + let(:symbol) { symbol } |
| 197 | + it "uses emacs:// scheme" do |
| 198 | + expect(subject.url("file", 42)).to start_with("emacs://") |
| 199 | + end |
| 200 | + end |
| 201 | + end |
| 202 | + |
| 203 | + [:macvim, :mvim].each do |symbol| |
| 204 | + context "when symbol is '#{symbol}'" do |
| 205 | + let(:symbol) { symbol } |
| 206 | + |
| 207 | + it "uses mvim:// scheme" do |
| 208 | + expect(subject.url("file", 42)).to start_with("mvim://") |
| 209 | + end |
| 210 | + end |
| 211 | + end |
| 212 | + |
| 213 | + [:sublime, :subl, :st].each do |symbol| |
| 214 | + context "when symbol is '#{symbol}'" do |
| 215 | + let(:symbol) { symbol } |
| 216 | + |
| 217 | + it "uses subl:// scheme" do |
| 218 | + expect(subject.url("file", 42)).to start_with("subl://") |
| 219 | + end |
| 220 | + end |
| 221 | + end |
| 222 | + |
| 223 | + [:textmate, :txmt, :tm].each do |symbol| |
| 224 | + context "when symbol is '#{symbol}'" do |
| 225 | + let(:symbol) { symbol } |
| 226 | + |
| 227 | + it "uses txmt:// scheme" do |
| 228 | + expect(subject.url("file", 42)).to start_with("txmt://") |
| 229 | + end |
| 230 | + end |
| 231 | + end |
| 232 | + end |
233 | 233 | end |
0 commit comments