Sha256: a69e2866c58babb7b36cd2e6e58b891db76b7a2a37cb3c2124688fafa2276c90

Contents?: true

Size: 1.48 KB

Versions: 4

Compression:

Stored size: 1.48 KB

Contents

$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
require 'test_helper'

context 'Installing from a remote git repo' do
  setup_with_fs do
    @source = fresh_remote_git('simple_c')
    @libpath = Rip.dir + '/active/lib/simple_c.rb'
    @addedrb = Rip.dir + '/active/lib/added.rb'
  end

  teardown do
    Rip::GitPackage.unmock_git
  end

  test "installs the lib files" do
    Rip::Commands.install({}, @source)
    assert File.exists?(@libpath), 'simple_c.rb should be installed'
  end

  test "fails on an unknown version" do
    Rip::Commands.install({}, @source, 'deadbeef')
    assert !File.exists?(@libpath), 'simple_c.rb should not be installed'
  end

  test "works with a real version" do
    Rip::Commands.install({}, @source, 'master')
    assert File.exists?(@addedrb), 'added.rb should be installed'
    assert File.exists?(@libpath), 'simple_c.rb should be installed'
  end

  test "works with an existing sha" do
    Rip::Commands.install({}, @source, '3f1d6da')
    assert !File.exists?(@addedrb), 'added.rb should not be installed'
    assert File.exists?(@libpath), 'simple_c.rb should be installed'
  end
end

context 'Installing from a local git repo' do
  setup_with_fs do
    @sources = fresh_local_git('simple_c')
  end

  teardown do
    Rip::GitPackage.unmock_git
  end

  test 'local installs the lib files' do
    Rip::Commands.install({}, @sources)
    libpath = Rip.dir + '/active/lib/simple_c.rb'
    assert File.exists?(libpath), 'simple_c.rb should be installed'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rip-0.0.4 test/git_test.rb
rip-0.0.5 test/git_test.rb
rip-0.0.3 test/git_test.rb
rip-0.0.2 test/git_test.rb