Sha256: 7e6dfdae7faa2adc2591576eb0901802b85a19dbf3d1564f3cf8e3bfb5d04b0f
Contents?: true
Size: 1.14 KB
Versions: 17
Compression:
Stored size: 1.14 KB
Contents
# encoding: utf-8 require 'spec_helper' require 'fedux_org_stdlib/remote_repository' RSpec.describe FeduxOrgStdlib::RemoteRepository do before :each do in_current_dir do repo = Rugged::Repository.init_at('remote_repo') oid = repo.write("This is a blob.", :blob) index = repo.index index.add(:path => "README.md", :oid => oid, :mode => 0100644) options = {} options[:tree] = index.write_tree(repo) options[:author] = { :email => "testuser@github.com", :name => 'Test Author', :time => Time.now } options[:committer] = { :email => "testuser@github.com", :name => 'Test Author', :time => Time.now } options[:message] ||= "Making a commit via Rugged!" options[:parents] = repo.empty? ? [] : [ repo.head.target ].compact options[:update_ref] = 'HEAD' Rugged::Commit.create(repo, options) end end context '#clone_to' do it 'clones remote repository' do repository = FeduxOrgStdlib::RemoteRepository.new("file://#{absolute_path('remote_repo')}") repository.clone_to absolute_path('dir') expect(Pathname.new(absolute_path('dir'))).to be_exist end end end
Version data entries
17 entries across 17 versions & 1 rubygems