Sha256: 36ee2934494974359e28ee06712cc12edd5706337164c002989a2f066b77f916

Contents?: true

Size: 1.08 KB

Versions: 50

Compression:

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

50 entries across 50 versions & 1 rubygems

Version Path
chef-15.17.4-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.17.4 spec/integration/recipes/provider_choice.rb
chef-15.16.7-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.16.7 spec/integration/recipes/provider_choice.rb
chef-15.16.4-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.16.4 spec/integration/recipes/provider_choice.rb
chef-15.16.2-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.16.2 spec/integration/recipes/provider_choice.rb
chef-15.15.0-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.15.0 spec/integration/recipes/provider_choice.rb
chef-15.14.0 spec/integration/recipes/provider_choice.rb
chef-15.14.0-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.13.8 spec/integration/recipes/provider_choice.rb
chef-15.13.8-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.12.22 spec/integration/recipes/provider_choice.rb
chef-15.12.22-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.11.8 spec/integration/recipes/provider_choice.rb
chef-15.11.8-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.11.3 spec/integration/recipes/provider_choice.rb
chef-15.11.3-universal-mingw32 spec/integration/recipes/provider_choice.rb