Sha256: c48964a87040f68404bb408403d01bdb06ea900f80c63b8a155d0d26d377a4ac

Contents?: true

Size: 1.06 KB

Versions: 15

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'
require 'berkshelf/dsl'

module Berkshelf
  describe DSL do
    subject do
      Class.new do
        include Berkshelf::DSL
      end.new
    end

    describe "#cookbook" do
      it "calls add source to the instance of the implementing class with a CookbookSource" do
        subject.should_receive(:add_source).with(kind_of(CookbookSource))
        
        subject.cookbook "ntp"
      end
    end

    describe '#group' do
      it "calls add source to the instance of the implementing class with a CookbookSource" do
        subject.should_receive(:add_source).with(kind_of(CookbookSource))
        
        subject.group "awesome" do
          subject.cookbook "ntp"
        end
      end
    end

    describe "#metadata" do
      before(:each) do
        Dir.chdir fixtures_path.join('cookbooks/example_cookbook')
      end

      it "calls add source to the instance of the implementing class with a CookbookSource" do
        subject.should_receive(:add_source).with(kind_of(CookbookSource))
        
        subject.metadata
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
berkshelf-0.4.0.rc4 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.4.0.rc3 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.4.0.rc2 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.4.0.rc1 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.3.7 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.3.3 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.3.2 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.3.1 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.3.0 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.2.0 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.1.5 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.1.4 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.1.3 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.1.2 spec/unit/berkshelf/dsl_spec.rb
berkshelf-0.1.1 spec/unit/berkshelf/dsl_spec.rb