Sha256: 263e3e38c0f2c2867ec5f510ca955daa9898e61ef005dd53797b4b969b23c2d8

Contents?: true

Size: 958 Bytes

Versions: 3

Compression:

Stored size: 958 Bytes

Contents

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
  def initialize ; end
end

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

%w[nugets_restore nugets_pack asmver build test_runner restore_hint_paths fpm_gen].each do |sym|
  method = :"#{sym}"
  describe "that #{method}(*args, &block) is included when doing `require 'albacore'`" do
    subject do
      X.new
    end
    it do
      subject.respond_to?(method, true).should be_true
    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
    subject.name.should eq('build')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
albacore-2.0.0.rc.17 spec/dsl_spec.rb
albacore-2.0.0.rc.15 spec/dsl_spec.rb
albacore-2.0.0.rc.14 spec/dsl_spec.rb