Sha256: a73e26cfb9546ceec247a8d6283ece4617410bfd082c43d35e786e09d69ba009

Contents?: true

Size: 870 Bytes

Versions: 15

Compression:

Stored size: 870 Bytes

Contents

require 'spec_helper'

describe MotherBrain::Chef::RunListItem do
  describe "#cookbook_name" do
    context "recipe item" do
      shared_examples "a recipe item" do
        it "should return the cookbook" do
          expect(subject.cookbook_name).to eq("foo")
        end
      end

      context do
        subject { described_class.new("recipe[foo::server]") }
        it_behaves_like "a recipe item"
      end

      context do
        subject { described_class.new("recipe[foo::server@1.1.2]") }
        it_behaves_like "a recipe item"
      end

      context do
        subject { described_class.new("recipe[foo]") }
        it_behaves_like "a recipe item"
      end
    end
    context "role item" do
      subject { described_class.new("role[foo]") }
      it "should return nil" do
        expect(subject.cookbook_name).to be_nil
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
motherbrain-1.5.0 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.4.0 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.3.0 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.2.1 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.2.0 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.1.3 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.1.2 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.1.1 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.1.0 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-1.0.0 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-0.14.5 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-0.14.4 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-0.14.3 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-0.14.2 spec/unit/mb/chef/run_list_item_spec.rb
motherbrain-0.13.1 spec/unit/mb/chef/run_list_item_spec.rb