Sha256: 03262b3cbdf179f6a72293319fd1504bf85af57164d44d979d8f23d779f8c80c

Contents?: true

Size: 1.77 KB

Versions: 2

Compression:

Stored size: 1.77 KB

Contents

require "spec_helper"

describe "spade uninstall" do
  before do
    goto_home
    set_host
    # TODO: Fix for LibGems
    env["GEM_HOME"] = spade_dir.to_s
    env["GEM_PATH"] = spade_dir.to_s
    start_fake(FakeGemServer.new)
  end
  
  it "uninstalls a gem" do
    spade "package", "install", "rake"
    wait
    spade "package", "uninstall", "rake"

    stdout.read.should include("Successfully uninstalled rake-0.8.7")
    "rake-0.8.7".should_not be_fetched
    "rake-0.8.7".should_not be_unpacked
  end

  it "uninstalls multiple packages" do
    spade "package", "install", "rake", "highline"
    wait
    spade "package", "uninstall", "rake", "highline"

    output = stdout.read
    output.should include("Successfully uninstalled rake-0.8.7")
    output.should include("Successfully uninstalled highline-1.6.1")

    "rake-0.8.7".should_not be_fetched
    "rake-0.8.7".should_not be_unpacked
    "highline-1.6.1".should_not be_fetched
    "highline-1.6.1".should_not be_unpacked
  end

  it "requires at least one package to uninstall" do
    spade "package", "uninstall", :track_stderr => true
    stderr.read.should include("called incorrectly")
  end

  it "fails when a package is not found" do
    spade "package", "uninstall", "webscale", :track_stderr => true
    stderr.read.should include(%{No packages installed named "webscale"})
  end

  it "will attempt to uninstall packages even when nonexisting one is given" do
    spade "package", "install", "rake", "highline"
    wait
    spade "package", "uninstall", "rake", "webscale", :track_stderr => true

    stdout.read.should include("Successfully uninstalled rake-0.8.7")
    "rake-0.8.7".should_not be_fetched
    "rake-0.8.7".should_not be_unpacked
    stderr.read.should include(%{No packages installed named "webscale"})
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spade-packager-0.1.0.1 spec/cli/uninstall_spec.rb
spade-packager-0.1.0 spec/cli/uninstall_spec.rb