Sha256: dc8636fb0f5eeb9743d7e5e9f348ad3b8423882c489d176d394de561116480da

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe ".vimmer/" do

  let(:settings) { Vimmer::Settings.new }

  it "can be moved with an environment variable" do
    ENV['VIMMER_HOME'] = app_root.join("tmp", ".vimmer").to_s
    settings.config_root.relative_path_from(app_root).to_s.should == "tmp/.vimmer"
    settings.config_file.relative_path_from(app_root).to_s.should == "tmp/.vimmer/config"
    ENV['VIMMER_HOME'] = nil
  end

  it "creates the .vimmer directory" do
    settings.create_vimmer_home!
    settings.config_root.should exist
  end


  it "creates the config file" do
    settings.create_default_config_file!
    settings.config_file.should exist
    File.read(settings.config_file).should =~ /bundle_path: ~\/.vim\/bundle/
  end


  it "expands the path when calling bundle_path" do
    ENV['VIMMER_HOME'] = vimmer_home.to_s

    bundle_path = app_root.join("lib", "..", "tmp", "bundle")
    File.open(vimmer_home.join("config").to_s, "w") do |f|
      f << "bundle_path: #{bundle_path}"
    end

    Vimmer::Settings.new[:bundle_path].should == File.expand_path(bundle_path)

    ENV['VIMMER_HOME'] = nil
  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vimmer-0.2.0 spec/settings_spec.rb