Sha256: 748782d99c2884494c9aff057b5b38a888590aac8eab6462a59e32c107c11409

Contents?: true

Size: 1.41 KB

Versions: 70

Compression:

Stored size: 1.41 KB

Contents

require 'spec_helper'
require 'support/sh_interceptor'
require 'albacore'
require 'albacore/task_types/build'

describe 'build config' do
  subject do
    Albacore::Build::Config.new
  end
  %w[file= sln= target target= logging logging= prop cores cores= tools_version tools_version=].each do |writer|
    it "should respond to :#{writer}" do
      expect(subject).to respond_to(:"#{writer}")
    end
  end
  it 'should not have any property' do
    expect(subject).to_not respond_to(:something_nonexistent)
  end

  describe 'when setting properties' do
    before do
      subject.logging = 'minimal'
      subject.tools_version = '3.5'
    end
    it do
      expect(subject.parameters).to include('/verbosity:minimal')
      expect(subject.parameters).to include('/toolsversion:3.5')
    end
  end
end

describe 'when running with sln' do
  let :cfg do
    Albacore::Build::Config.new
  end

  include_context 'path testing'

  let(:cmd) do
    cmd = Albacore::Build::Cmd.new cfg.work_dir, 'xbuild', cfg.parameters
    cmd.extend ShInterceptor
  end

  before do
    cfg.sln = 'src/HelloWorld.sln'
    cfg.target = %w|Clean Build|
    cmd.execute
  end

  subject do
    cmd
  end

  it do
    expect(subject.executable).to eq('xbuild')
  end
  it do
    expect(subject.parameters).to eq(%W|/verbosity:minimal #{path 'src/HelloWorld.sln'} /target:Clean;Build|)
  end
  it do
    expect(subject.is_mono_command?).to be false
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
albacore-2.6.1 spec/build_spec.rb
albacore-2.6.0 spec/build_spec.rb
albacore-2.5.14 spec/build_spec.rb
albacore-2.5.13 spec/build_spec.rb
albacore-2.5.11 spec/build_spec.rb
albacore-2.5.10 spec/build_spec.rb
albacore-2.5.9 spec/build_spec.rb
albacore-2.5.8 spec/build_spec.rb
albacore-2.5.6 spec/build_spec.rb
albacore-2.5.5 spec/build_spec.rb
albacore-2.5.4 spec/build_spec.rb
albacore-2.5.3 spec/build_spec.rb
albacore-2.5.2 spec/build_spec.rb
albacore-2.5.1 spec/build_spec.rb
albacore-2.5.0 spec/build_spec.rb
albacore-2.4.3 spec/build_spec.rb
albacore-2.4.2 spec/build_spec.rb
albacore-2.4.1 spec/build_spec.rb
albacore-2.4.0 spec/build_spec.rb
albacore-2.3.22 spec/build_spec.rb