diff options
author | Luke Kanies <luke@reductivelabs.com> | 2010-03-16 09:05:02 -0700 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 44cba9cfb85a43f758c457bf3a5e661706f1e8f3 (patch) | |
tree | aac6ed83ab671bd07d91e8cfd9235d89688887c3 /spec | |
parent | d05d25c3fd1c3472060504edfa4fa3037bdd9781 (diff) | |
download | puppet-44cba9cfb85a43f758c457bf3a5e661706f1e8f3.tar.gz puppet-44cba9cfb85a43f758c457bf3a5e661706f1e8f3.tar.xz puppet-44cba9cfb85a43f758c457bf3a5e661706f1e8f3.zip |
Adding "checksum?" helper method to Checksums module
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/util/checksums.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/unit/util/checksums.rb b/spec/unit/util/checksums.rb index 615ed902c..e0c990962 100755 --- a/spec/unit/util/checksums.rb +++ b/spec/unit/util/checksums.rb @@ -28,6 +28,22 @@ describe Puppet::Util::Checksums do end end + it "should have a method for determining whether a given string is a checksum" do + @summer.should respond_to(:checksum?) + end + + %w{{md5}asdfasdf {sha1}asdfasdf {ctime}asdasdf {mtime}asdfasdf}.each do |sum| + it "should consider #{sum} to be a checksum" do + @summer.should be_checksum(sum) + end + end + + %w{{nosuchsum}asdfasdf {a}asdfasdf {ctime}}.each do |sum| + it "should not consider #{sum} to be a checksum" do + @summer.should_not be_checksum(sum) + end + end + it "should have a method for stripping a sum type from an existing checksum" do @summer.sumtype("{md5}asdfasdfa").should == "md5" end |