diff options
| author | Markus Roberts <Markus@reality.com> | 2010-07-09 15:58:04 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-09 15:58:04 -0700 |
| commit | 5bab997c39e72c87cd688f7f21b1a6f446fb30f5 (patch) | |
| tree | 13e14288dbaeab5bc3c779eb0847b6b506fed471 | |
| parent | 654b5647a4dd7118c17a8d887dff09a8c6648c61 (diff) | |
maint:rename resource_type to define in internal dsl
That's it. Now its got the same name internal or external.
| -rw-r--r-- | lib/puppet/dsl/resource_type_api.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/dsl/resource_type_api_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/dsl/resource_type_api.rb b/lib/puppet/dsl/resource_type_api.rb index 014d1a3dc..ba489680d 100644 --- a/lib/puppet/dsl/resource_type_api.rb +++ b/lib/puppet/dsl/resource_type_api.rb @@ -1,7 +1,7 @@ require 'puppet/resource/type' module Puppet::DSL::ResourceTypeAPI - def resource_type(name, *args, &block) + def define(name, *args, &block) result = mk_resource_type(:definition, name, Hash.new, block) result.set_arguments(munge_type_arguments(args)) result diff --git a/spec/unit/dsl/resource_type_api_spec.rb b/spec/unit/dsl/resource_type_api_spec.rb index 8d63bf28e..e9b52ee16 100755 --- a/spec/unit/dsl/resource_type_api_spec.rb +++ b/spec/unit/dsl/resource_type_api_spec.rb @@ -14,7 +14,7 @@ describe Puppet::DSL::ResourceTypeAPI do end [:definition, :node, :hostclass].each do |type| - method = type == :definition ? "resource_type" : type + method = type == :definition ? "define" : type it "should be able to create a #{type}" do newtype = Puppet::Resource::Type.new(:hostclass, "foo") Puppet::Resource::Type.expects(:new).with { |t, n, args| t == type }.returns newtype |
