Sha256: fe9290be7a62b1bd9ae06e31a158e1eef67e32b686c8751db133d966998aa400

Contents?: true

Size: 959 Bytes

Versions: 73

Compression:

Stored size: 959 Bytes

Contents

require 'albacore/dsl'
require 'spec_helper'

describe "what methods are included by default" do
  require 'albacore'
  class A ; include Albacore::DSL ; end
  subject { A.new.method(:sh).to_s }
  it { should include("Albacore::CrossPlatformCmd") } 
end

class X
  include Albacore::DSL
end

#puts "X has methods: #{X.new.private_methods.inspect}"

%w[nugets_restore nugets_pack asmver build test_runner restore_hint_paths appspecs].each do |sym|
  method = :"#{sym}"
  describe "that #{method}(*args, &block) is included when doing `require 'albacore'`" do
    subject do
      X.new
    end
    it do
      expect(subject.method(method)).to_not be nil
    end
  end
end

describe 'calling dsl method without symbol name' do
  subject do
    x = X.new
    # calling the #build method in the dsl without any name should name it
    x.method(:build).call do |b|
    end
  end
  it 'should be named "build"' do
    expect(subject.name).to eq('build')
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
albacore-2.4.1 spec/dsl_spec.rb
albacore-2.4.0 spec/dsl_spec.rb
albacore-2.3.22 spec/dsl_spec.rb
albacore-2.3.21 spec/dsl_spec.rb
albacore-2.3.20 spec/dsl_spec.rb
albacore-2.3.19 spec/dsl_spec.rb
albacore-2.3.18 spec/dsl_spec.rb
albacore-2.3.17 spec/dsl_spec.rb
albacore-2.3.16 spec/dsl_spec.rb
albacore-2.3.15 spec/dsl_spec.rb
albacore-2.3.14 spec/dsl_spec.rb
albacore-2.3.13 spec/dsl_spec.rb
albacore-2.3.12 spec/dsl_spec.rb
albacore-2.3.11 spec/dsl_spec.rb
albacore-2.3.10 spec/dsl_spec.rb
albacore-2.3.9 spec/dsl_spec.rb
albacore-2.3.8 spec/dsl_spec.rb
albacore-2.3.7 spec/dsl_spec.rb
albacore-2.3.6 spec/dsl_spec.rb
albacore-2.3.5 spec/dsl_spec.rb