Sha256: bedaf8458d90a7e194067f49139eedaaebad08a7ac27b5a34eafc03b55559e10

Contents?: true

Size: 690 Bytes

Versions: 8

Compression:

Stored size: 690 Bytes

Contents

require 'spec_helper'
require 'tmpdir'

describe Klipp::Configuration do

  it 'points to .klipp inside the user\'s home directory' do
    Klipp::Configuration.root_dir.should eq File.join(Dir.home, '.klipp')
  end

  context 'with auto create enabled' do

    before do
      Klipp::Configuration.auto_create_dirs = true
    end

    it 'auto creates the .klipp directory' do
      Dir.expects(:mkdir).once
      File.expects(:exists?).once.returns false
      Klipp::Configuration.root_dir
    end

  end

  context 'with root dir pointing to fixtures' do

    before do
      Klipp::Configuration.stubs(:root_dir).returns(File.join(File.dirname(__dir__), 'fixtures'))
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
klipp-0.2.2.5 spec/klipp/configuration_spec.rb
klipp-0.2.2.4 spec/klipp/configuration_spec.rb
klipp-0.2.2.3 spec/klipp/configuration_spec.rb
klipp-0.2.2.2 spec/klipp/configuration_spec.rb
klipp-0.2.2.1 spec/klipp/configuration_spec.rb
klipp-0.2.2 spec/klipp/configuration_spec.rb
klipp-0.2.1 spec/klipp/configuration_spec.rb
klipp-0.2.0 spec/klipp/configuration_spec.rb