Sha256: 2330f450ad7705e315713ffe32c0f60c83a8165f0e3ec206993ff6348c878e11

Contents?: true

Size: 1.29 KB

Versions: 9

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'
require 'albacore/nugetupdate'
require 'albacore/config/nugetupdateconfig'

describe NuGetUpdate do  
  before :each do
    @nugetupdate = NuGetUpdate.new
    @strio = StringIO.new
    @nugetupdate.log_device = @strio
    @nugetupdate.log_level = :diagnostic
  end
  
  context "when no path to NuGet is specified" do
    it "assumes NuGet is in the path" do
      @nugetupdate.command.should == "NuGet.exe"
    end
  end

  it "generates the correct command-line parameters" do
    @nugetupdate.input_file = "../support/TestSolution/TestSolution.sln"
    @nugetupdate.source = "source1", "source2"
    @nugetupdate.id = "id1", "id2"
    @nugetupdate.repository_path = "repopath"
    
    params = @nugetupdate.get_command_parameters
    params.should include(@nugetupdate.input_file)
    params.should include("-Source \"source1;source2\"")
    params.should include("-Id \"id1;id2\"")
    params.should include("-RepositoryPath repopath")
    params.should_not include("-Self")
    
    @nugetupdate.safe = true
    params = @nugetupdate.get_command_parameters
    params.should include("-Safe")
  end
  
  it "fails if no input file is supplied" do
    @nugetupdate.extend(FailPatch)
    @nugetupdate.get_command_parameters
    @strio.string.should include("An input file must be specified")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
albacore-0.3.6 spec/nugetupdate_spec.rb
albacore-1.0.0.rc.2 spec/nugetupdate_spec.rb
albacore-1.0.0.rc.1 spec/nugetupdate_spec.rb
albacore-0.3.5 spec/nugetupdate_spec.rb
albacore-0.3.4 spec/nugetupdate_spec.rb
albacore-0.3.3 spec/nugetupdate_spec.rb
albacore-0.3.2 spec/nugetupdate_spec.rb
albacore-0.3.1 spec/nugetupdate_spec.rb
albacore-0.3.0 spec/nugetupdate_spec.rb