Sha256: c38fa44c264048185ad898d91809ed1c18d2cdbf06e3bd46aec7b90e0ddc9528

Contents?: true

Size: 1.09 KB

Versions: 104

Compression:

Stored size: 1.09 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
          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

104 entries across 104 versions & 1 rubygems

Version Path
chef-12.20.3 spec/integration/recipes/provider_choice.rb
chef-12.20.3-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.0.118-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.0.118 spec/integration/recipes/provider_choice.rb
chef-13.0.113-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.0.113 spec/integration/recipes/provider_choice.rb
chef-12.19.36-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-12.19.36 spec/integration/recipes/provider_choice.rb
chef-12.19.33 spec/integration/recipes/provider_choice.rb
chef-12.19.33-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-12.18.31-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-12.18.31 spec/integration/recipes/provider_choice.rb
chef-12.17.44-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-12.17.44 spec/integration/recipes/provider_choice.rb
chef-12.16.42 spec/integration/recipes/provider_choice.rb
chef-12.16.42-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-12.15.19 spec/integration/recipes/provider_choice.rb
chef-12.15.19-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-12.14.89-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-12.14.89 spec/integration/recipes/provider_choice.rb