summaryrefslogtreecommitdiff
path: root/spec/unit/property_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/property_spec.rb')
-rw-r--r--spec/unit/property_spec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb
index dc969ebde2..fc0c942c20 100644
--- a/spec/unit/property_spec.rb
+++ b/spec/unit/property_spec.rb
@@ -8,12 +8,15 @@ describe "Chef::Resource.property" do
def self.next_resource_name
"chef_resource_property_spec_#{@i += 1}"
end
+
def self.reset_index
@current_index = 0
end
+
def self.current_index
@current_index
end
+
def self.next_index
@current_index += 1
end
@@ -52,9 +55,9 @@ describe "Chef::Resource.property" do
end
def self.with_property(*properties, &block)
- tags_index = properties.find_index { |p| !p.is_a?(String)}
+ tags_index = properties.find_index { |p| !p.is_a?(String) }
if tags_index
- properties, tags = properties[0..tags_index-1], properties[tags_index..-1]
+ properties, tags = properties[0..tags_index - 1], properties[tags_index..-1]
else
tags = []
end
@@ -551,6 +554,7 @@ describe "Chef::Resource.property" do
def self.blah
"class"
end
+
def blah
"#{name}#{next_index}"
end
@@ -800,6 +804,7 @@ describe "Chef::Resource.property" do
def self.blah
"class"
end
+
def blah
"#{name}#{Namer.next_index}"
end
@@ -1081,7 +1086,6 @@ describe "Chef::Resource.property" do
end
end
end
-
end
end
@@ -1169,7 +1173,6 @@ describe "Chef::Resource.property" do
end
end
end
-
end
context "with a custom property type" do