]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(#3) Add simple unit test for anchor type
authorJeff McCune <jeff@puppetlabs.com>
Wed, 15 Jun 2011 16:43:22 +0000 (09:43 -0700)
committerJeff McCune <jeff@puppetlabs.com>
Wed, 15 Jun 2011 16:44:24 +0000 (09:44 -0700)
Unlike the whit type the anchor type derives from, we are not hacking
the stringify method.  We expect the resource to be named simply
Anchor[foo::bar] where the name is "foo::bar".

spec/unit/puppet/type/anchor_spec.rb [new file with mode: 0644]

diff --git a/spec/unit/puppet/type/anchor_spec.rb b/spec/unit/puppet/type/anchor_spec.rb
new file mode 100644 (file)
index 0000000..2030b83
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env ruby
+
+require 'puppet'
+
+anchor = Puppet::Type.type(:anchor).new(:name => "ntp::begin")
+
+describe anchor do
+  it "should stringify normally" do
+    anchor.to_s.should == "Anchor[ntp::begin]"
+  end
+end