Sha256: 75c2fe629db7de47dfbf51ed601e4b4e1e066ad8ad7960a6671610e3eefebfde

Contents?: true

Size: 1.64 KB

Versions: 39

Compression:

Stored size: 1.64 KB

Contents

require 'spec_helper'
require 'albacore'
require 'albacore/task_types/nugets_restore'
require 'albacore/dsl'
require 'support/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.mono_parameters }
end


describe Albacore::NugetsRestore::RemoveSourceCmd, 'when calling #execute should remove source' 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 should remove source' 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 with specific source' 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) {
    Albacore::Paths.normalise_slashes('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

39 entries across 39 versions & 1 rubygems

Version Path
albacore-2.1.2 spec/nugets_restore_spec.rb
albacore-2.1.1 spec/nugets_restore_spec.rb
albacore-2.0.16 spec/nugets_restore_spec.rb
albacore-2.0.15 spec/nugets_restore_spec.rb
albacore-2.0.14 spec/nugets_restore_spec.rb
albacore-2.0.13 spec/nugets_restore_spec.rb
albacore-2.0.12 spec/nugets_restore_spec.rb
albacore-2.0.11 spec/nugets_restore_spec.rb
albacore-2.0.10 spec/nugets_restore_spec.rb
albacore-2.0.9 spec/nugets_restore_spec.rb
albacore-2.0.8 spec/nugets_restore_spec.rb
albacore-2.0.7 spec/nugets_restore_spec.rb
albacore-2.0.6 spec/nugets_restore_spec.rb
albacore-2.0.5 spec/nugets_restore_spec.rb
albacore-2.0.4 spec/nugets_restore_spec.rb
albacore-2.0.3 spec/nugets_restore_spec.rb
albacore-2.0.2 spec/nugets_restore_spec.rb
albacore-2.0.1 spec/nugets_restore_spec.rb
albacore-2.0.0 spec/nugets_restore_spec.rb
albacore-2.0.0.rc.21 spec/nugets_restore_spec.rb