Sha256: 6f8eba6f21caf18e5dd7e55b76b807b5f6657a74849c58b0466fed8bf6ff60bb

Contents?: true

Size: 1007 Bytes

Versions: 26

Compression:

Stored size: 1007 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'
require 'gemirro/mirror_directory'
require 'gemirro/mirror_file'

# MirrorDirectory tests
module Gemirro
  describe 'MirrorDirectory' do
    include FakeFS::SpecHelpers

    before(:each) do
      @mirror_directory = MirrorDirectory.new('./')
    end

    it 'should be initialized' do
      expect(@mirror_directory.path).to eq('./')
    end

    it 'should add directory' do
      expect(@mirror_directory.add_directory('test/test2'))
        .to be_a(MirrorDirectory)
      expect(File.directory?('./test/test2')).to be_truthy
    end

    it 'should add file' do
      result = @mirror_directory.add_file('file', 'content')
      expect(result).to be_a(MirrorFile)
      expect(result.read).to eq('content')
    end

    it 'should test if file exists' do
      expect(@mirror_directory.file_exists?('test')).to be_falsy
      @mirror_directory.add_file('test', 'content')
      expect(@mirror_directory.file_exists?('test')).to be_truthy
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
gemirro-0.13.5 spec/gemirro/mirror_directory_spec.rb
gemirro-0.13.4 spec/gemirro/mirror_directory_spec.rb
gemirro-0.13.3 spec/gemirro/mirror_directory_spec.rb
gemirro-0.13.2 spec/gemirro/mirror_directory_spec.rb
gemirro-0.13.1 spec/gemirro/mirror_directory_spec.rb
gemirro-0.12.0 spec/gemirro/mirror_directory_spec.rb
gemirro-0.11.0 spec/gemirro/mirror_directory_spec.rb
gemirro-0.10.5 spec/gemirro/mirror_directory_spec.rb
gemirro-0.10.4 spec/gemirro/mirror_directory_spec.rb
gemirro-0.10.3 spec/gemirro/mirror_directory_spec.rb
gemirro-0.10.2 spec/gemirro/mirror_directory_spec.rb
gemirro-0.10.1 spec/gemirro/mirror_directory_spec.rb
gemirro-0.10.0 spec/gemirro/mirror_directory_spec.rb
gemirro-0.9.1 spec/gemirro/mirror_directory_spec.rb
gemirro-0.9.0 spec/gemirro/mirror_directory_spec.rb
gemirro-0.8.1 spec/gemirro/mirror_directory_spec.rb
gemirro-0.8.0 spec/gemirro/mirror_directory_spec.rb
gemirro-0.7.0 spec/gemirro/mirror_directory_spec.rb
gemirro-0.6.0 spec/gemirro/mirror_directory_spec.rb
gemirro-0.5.0 spec/gemirro/mirror_directory_spec.rb