Sha256: ed11ecef80909ca92198659e68ce541aca7dfdaca6c0c01cdb122ef3e9835284

Contents?: true

Size: 881 Bytes

Versions: 3

Compression:

Stored size: 881 Bytes

Contents

require 'spec_helper'

describe 'Switcher' do
  describe 'use' do
    context 'system vim' do
      before :all do
        Switcher.new('system').use
      end

      it 'delete current' do
        expect(File.exist?(get_current_dir)).not_to be_true
      end
    end

    context 'different version' do
      before :all do
        version = VERSION1
        Switcher.new(version).use
        @vims_dir = get_vims_dir(version)
        @current  = get_current_dir
      end

      it 'exist current' do
        expect(File.exist?(@current)).to be_true
      end

      it 'switch current' do
        expect(File.readlink(@current)).to eq @vims_dir
      end
    end

    context 'unknown version' do
      before :all do
        @switcher = Switcher.new('v7-5')
      end

      it 'raise error' do
        expect(proc { @switcher.use }).to raise_error
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vvm-rb-0.2.2 spec/switcher_spec.rb
vvm-rb-0.2.1 spec/switcher_spec.rb
vvm-rb-0.2.0 spec/switcher_spec.rb