Sha256: daa4387b46281cabca71a900ff22e58ef1e7fbba9046c374319ed1cc6adda96f

Contents?: true

Size: 944 Bytes

Versions: 16

Compression:

Stored size: 944 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe GitFile do
  context 'initialize' do
    it 'requires a path' do
      expect {
        GitFile.new('dir/path.txt')
      }.not_to raise_error
    end

    it 'accepts content' do
      expect {
        GitFile.new('dir/path.txt', 'content')
      }.not_to raise_error
    end
  end

  context '#name' do
    it 'has a name' do
      file = GitFile.new('file.txt')
      expect(file.name).to eq(:file)
    end
  end

  context '#extension?' do
    it 'checks if extension is the same' do
      file = GitFile.new('path.txt')
      expect(file).to be_extension('.txt')
    end
  end

  context '#content' do
    it 'returns the content of file' do
      file = GitFile.new('file.txt', 'content')
      expect(file.content).to eq('content')
    end
  end

  context '#nil?' do
    it 'is always false' do
      file = GitFile.new('file.txt')
      expect(file.nil?).to be_false
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
proxy_tester-0.1.6 spec/git_file_spec.rb
proxy_tester-0.1.5 spec/git_file_spec.rb
proxy_tester-0.1.4 spec/git_file_spec.rb
proxy_tester-0.1.3 spec/git_file_spec.rb
proxy_tester-0.1.2 spec/git_file_spec.rb
proxy_tester-0.1.1 spec/git_file_spec.rb
proxy_tester-0.1.0 spec/git_file_spec.rb
proxy_tester-0.0.9 spec/git_file_spec.rb
proxy_tester-0.0.8 spec/git_file_spec.rb
proxy_tester-0.0.7 spec/git_file_spec.rb
proxy_tester-0.0.6 spec/git_file_spec.rb
proxy_tester-0.0.5 spec/git_file_spec.rb
proxy_tester-0.0.4 spec/git_file_spec.rb
proxy_tester-0.0.3 spec/git_file_spec.rb
proxy_tester-0.0.2 spec/git_file_spec.rb
proxy_tester-0.0.1 spec/git_file_spec.rb