summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/transaction.rb10
-rwxr-xr-xspec/unit/util/tagging.rb10
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/unit/transaction.rb b/spec/unit/transaction.rb
index 4763b9865..b419d4e71 100755
--- a/spec/unit/transaction.rb
+++ b/spec/unit/transaction.rb
@@ -80,6 +80,16 @@ describe Puppet::Transaction do
@transaction.skip?(@resource).should be_true
end
+ it "should ask the resource if it's tagged with any of the tags" do
+ tags = ['one', 'two']
+ @transaction.stubs(:ignore_tags?).returns(false)
+ @transaction.stubs(:tags).returns(tags)
+
+ @resource.expects(:tagged?).with(*tags).returns(true)
+
+ @transaction.missing_tags?(@resource).should be_false
+ end
+
it "should skip not scheduled resources" do
@transaction.stubs(:scheduled?).returns(false)
@transaction.skip?(@resource).should be_true
diff --git a/spec/unit/util/tagging.rb b/spec/unit/util/tagging.rb
index d61ee8ccb..3486f46f2 100755
--- a/spec/unit/util/tagging.rb
+++ b/spec/unit/util/tagging.rb
@@ -89,4 +89,14 @@ describe Puppet::Util::Tagging, "when adding tags" do
it "should indicate when the object is not tagged with a provided tag" do
@tagger.should_not be_tagged("one")
end
+
+ it "should indicate when the object is tagged with any tag in an array" do
+ @tagger.tag("one")
+ @tagger.should be_tagged("one","two","three")
+ end
+
+ it "should indicate when the object is not tagged with any tag in an array" do
+ @tagger.tag("one")
+ @tagger.should_not be_tagged("two","three")
+ end
end