Sha256: b6d03279e9981263ac9fa0ad4720903e3969dea7ac895324a7496bf481544043

Contents?: true

Size: 947 Bytes

Versions: 1

Compression:

Stored size: 947 Bytes

Contents

require 'spec_helper'
require 'chef/rewind'

class ResourceTestHarness < Chef::Resource
  provider_base Chef::Provider::Package
end

describe Chef::Resource do
  before(:each) do
    @cookbook_repo_path =  File.join(CHEF_SPEC_DATA, 'cookbooks')
    @cookbook_collection = Chef::CookbookCollection.new(Chef::CookbookLoader.new(@cookbook_repo_path))
    @node = Chef::Node.new
    @events = Chef::EventDispatch::Dispatcher.new
    @run_context = Chef::RunContext.new(@node, @cookbook_collection, @events)
    @resource = Chef::Resource.new("funk", @run_context)
  end

  describe "cookbook_name" do
    it "cookbook_name sets @cookbook_name properly" do
      @resource.cookbook_name "foobar"
      expect(@resource.cookbook_name).to eq "foobar"
    end

  end

  describe "recipe_name" do
    it "recipe_name sets @recipe_name properly" do
      @resource.recipe_name "foobar"
      expect(@resource.recipe_name).to eq "foobar"
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chef-rewind-0.0.9 spec/rewind_resource_spec.rb