Sha256: d7aa84f6407ef68168b737cb28a31edea31883ce595636f0efa50bc352db78ea

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

require 'spec_helper'
require 'albacore'
require 'albacore/nugets_restore'
require 'albacore/dsl'
require 'sh_interceptor'

class NGConf
  self.extend Albacore::DSL 
end

shared_context 'cmd context' do
  let (:hafsrc) { OpenStruct.new(:name => 'haf-source', :uri => 'https://haf.se/nugets') }
  before(:each) { cmd.extend ShInterceptor }
  subject { cmd.execute ; cmd.received_args[1] }
end


describe Albacore::NugetsRestore::RemoveSourceCmd, 'when calling #execute' do
  let(:cmd) { Albacore::NugetsRestore::RemoveSourceCmd.new 'nuget.exe', hafsrc }
  include_context 'cmd context'
  %w[remove sources -name haf-source].each { |k|
    it { should include(k) }
  }
end

describe Albacore::NugetsRestore::AddSourceCmd, 'when calling #execute' do
  let (:cmd) { Albacore::NugetsRestore::AddSourceCmd.new 'nuget.exe', hafsrc, 'u', 'p' }
  include_context 'cmd context'
  %w[sources add -name haf-source].each { |k|
    it { should include(k) }
  }
end

describe Albacore::NugetsRestore::Cmd, "when calling #execute" do
  
  let (:cmd) { 
    cfg = Albacore::NugetsRestore::Config.new
    cfg.out = 'src/packages'
    cfg.add_parameter '-Source' 
    cfg.add_parameter 'http://localhost:8081'

    cmd = Albacore::NugetsRestore::Cmd.new nil, 'NuGet.exe', cfg.opts_for_pkgcfg('src/Proj/packages.config')
  }

  let (:path) {
    ::Rake::Win32.windows?() ? 'src\\Proj\\packages.config' : 'src/Proj/packages.config' 
  }

  include_context 'cmd context'

  %W[install -OutputDirectory src/packages -Source http://localhost:8081].each { |parameter|
    it { should include(parameter) }
  }
  it { should include(path) }
end 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
albacore-0.6.2.rc1 spec/nugets_restore_spec.rb