Sha256: a946d467852843f864ec609b25777118e594adc147fb5b5f546f98af73a23a7c
Contents?: true
Size: 1.01 KB
Versions: 27
Compression:
Stored size: 1.01 KB
Contents
# encoding: utf-8 require 'spec_helper' require 'fedux_org_stdlib/editor' RSpec.describe FeduxOrgStdlib::Editor do around :example do |example| with_env 'PATH' => absolute_path('.') do example.run end end context '#path' do let(:editor) { Editor.new } Editor.new.known_commands.each do |c| it "finds editor #{c}" do touch_file c filesystem_permissions '0755', c expect(editor.path).to eq absolute_path(c) end end it 'changes search path' do touch_file 'vim' filesystem_permissions '0755', 'vim' editor = Editor.new search_paths: absolute_path('.') expect(editor.path).to eq absolute_path('vim') end it 'changes default editors' do touch_file 'vi' filesystem_permissions '0755', 'vi' editor = Editor.new editors: %w(vi) expect(editor.path).to eq absolute_path('vi') end it 'returns nil if no editor can be found' do editor = Editor.new expect(editor.path).to be nil end end end
Version data entries
27 entries across 27 versions & 1 rubygems