Sha256: 739303a5098e860e1851cb8b26e4b78c0c06a6869ea5c4acc9acfdadf6e1d479

Contents?: true

Size: 1.13 KB

Versions: 30

Compression:

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

30 entries across 30 versions & 1 rubygems

Version Path
chef-14.13.11-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.0.300-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.0.298-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-15.0.293-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.12.9-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.12.3-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.12.14-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.11.21-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.10.9-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.9.13-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.8.12-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.7.17-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.12.3-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.6.47-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.11.3-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.5.33-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.10.4-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-14.3.37-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.10.0-universal-mingw32 spec/integration/recipes/provider_choice.rb
chef-13.9.4-universal-mingw32 spec/integration/recipes/provider_choice.rb