Sha256: f3ec909041d52210e6af8f84039cf0571f33313afb9b062133525539a1d92ce7

Contents?: true

Size: 1.12 KB

Versions: 111

Compression:

Stored size: 1.12 KB

Contents

require "support/shared/integration/integration_helper"

describe "Recipe DSL methods" do
  include IntegrationSupport

  context "With resource class providing 'provider_thingy'" do
    before :context do
      class Chef::Resource::ProviderThingy < Chef::Resource
        resource_name :provider_thingy
        default_action :create
        def to_s
          "provider_thingy resource class"
        end
      end
    end
    context "And class Chef::Provider::ProviderThingy with no provides" do
      before :context do
        class Chef::Provider::ProviderThingy < Chef::Provider
          provides :provider_thingy

          def load_current_resource; end

          def action_create
            Chef::Log.warn("hello from #{self.class.name}")
          end
        end
      end

      it "provider_thingy 'blah' runs the provider and warns" do
        recipe = converge do
          provider_thingy("blah") {}
        end
        expect(recipe.logged_warnings).to match(/hello from Chef::Provider::ProviderThingy/)
        expect(recipe.logged_warnings).to match(/you must use 'provides' to provide DSL/i)
      end
    end
  end
end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
chef-16.16.13 spec/integration/recipes/provider_choice.rb
chef-17.6.18-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-17.6.18 spec/integration/recipes/provider_choice.rb
chef-17.6.15-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-17.6.15 spec/integration/recipes/provider_choice.rb
chef-16.16.7-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-16.16.7 spec/integration/recipes/provider_choice.rb
chef-17.5.22-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-17.5.22 spec/integration/recipes/provider_choice.rb
chef-16.15.22-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-16.15.22 spec/integration/recipes/provider_choice.rb
chef-17.4.38-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-17.4.38 spec/integration/recipes/provider_choice.rb
chef-17.4.25-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-17.4.25 spec/integration/recipes/provider_choice.rb
chef-16.14.1-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-16.14.1 spec/integration/recipes/provider_choice.rb
chef-17.3.48-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-17.3.48 spec/integration/recipes/provider_choice.rb
chef-17.2.29-universal-mingw32 spec/integration/recipes/provider_choice.rb