Sha256: 29b18e9feaa463723bf49aebb08ccadade870ed2cb94c92a4b80e5ff98791f34

Contents?: true

Size: 853 Bytes

Versions: 5

Compression:

Stored size: 853 Bytes

Contents

require 'spec_helper'
require 'fileutils'

describe TDiary do
  describe 'LOAD_PATH' do
    before do
      @root_path = File.expand_path(File.dirname(__FILE__) + '/../..')
      @loaded_paths = $LOAD_PATH.map{|path| File.expand_path(path)}
    end

    it "include misc path into load path" do
      expect(@loaded_paths).to be_include @root_path + '/misc/lib'
    end

    context 'append gem' do
      before do
        FileUtils.mkdir_p @root_path + '/misc/lib/foo-0.0.1/lib'
        load @root_path + '/lib/tdiary.rb'
        @loaded_paths = $LOAD_PATH.map{|path| File.expand_path(path)}
      end

      it "include append gem path into load path" do
        expect(@loaded_paths).to be_include @root_path + '/misc/lib/foo-0.0.1/lib'
      end

      after do
        FileUtils.rm_rf @root_path + '/misc/lib/foo-0.0.1'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/tdiary-4.2.0/spec/core/tdiary_spec.rb
tdiary-4.2.0 spec/core/tdiary_spec.rb
tdiary-4.1.3 spec/core/tdiary_spec.rb
tdiary-4.1.2 spec/core/tdiary_spec.rb
tdiary-4.1.1 spec/core/tdiary_spec.rb