Sha256: d485c2bcfa17414f42033a3e11dadcf816db0249b3a31fe57a4a72ec39355cf4

Contents?: true

Size: 1.36 KB

Versions: 17

Compression:

Stored size: 1.36 KB

Contents

require 'albacore/task_types/asmver'

describe ::Albacore::Asmver::Config, 'when setting attributes and out' do
  let :strio do
    StringIO.new
  end
  subject do
    ::Albacore::Asmver::Config.new
  end
  def task
    @task
  end
  before :each do
    subject.file_path = 'Version.fs'
    subject.namespace = 'Hello.World'
    subject.attributes guid: 'b766f4f3-3f4e-49d0-a451-9c152059ae81',
      assembly_version: '0.1.2'
    subject.out = strio
    @task = ::Albacore::Asmver::Task.new(subject.opts)
    @task.execute
  end
  it 'should write namespace' do
    expect(strio.string).to include('namespace Hello.World')
  end
  it 'should write Guid("...")' do
    expect(strio.string).to include('[<assembly: Guid("b766f4f3-3f4e-49d0-a451-9c152059ae81")>]')
  end
  it 'should write AssemblyVersion' do
    expect(strio.string).to include('[<assembly: AssemblyVersion("0.1.2")>]')
  end
  it 'should allow changing attributes' do
    expect(subject).to respond_to :change_attributes
  end
  it 'should allow reading namespace' do
    expect(subject.namespace).to eq 'Hello.World'
  end
  it 'should allow reading file_path' do
    expect(subject.file_path).to eq 'Version.fs'
  end
  it 'should allow getting and setting attributes' do
    subject.change_attributes do |as|
      as[:a_key] = '123'
    end
    expect(subject.change_attributes { |a| a[:a_key] }).to eq '123'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
albacore-2.6.2 spec/asmver_task_spec.rb
albacore-2.6.1 spec/asmver_task_spec.rb
albacore-2.6.0 spec/asmver_task_spec.rb
albacore-2.5.14 spec/asmver_task_spec.rb
albacore-2.5.13 spec/asmver_task_spec.rb
albacore-2.5.11 spec/asmver_task_spec.rb
albacore-2.5.10 spec/asmver_task_spec.rb
albacore-2.5.9 spec/asmver_task_spec.rb
albacore-2.5.8 spec/asmver_task_spec.rb
albacore-2.5.6 spec/asmver_task_spec.rb
albacore-2.5.5 spec/asmver_task_spec.rb
albacore-2.5.4 spec/asmver_task_spec.rb
albacore-2.5.3 spec/asmver_task_spec.rb
albacore-2.5.2 spec/asmver_task_spec.rb
albacore-2.5.1 spec/asmver_task_spec.rb
albacore-2.5.0 spec/asmver_task_spec.rb
albacore-2.4.3 spec/asmver_task_spec.rb