summaryrefslogtreecommitdiffstats
path: root/spec/unit/network/format.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-09-23 23:50:43 -0500
committerLuke Kanies <luke@madstop.com>2008-09-23 23:50:43 -0500
commitbb23861e334e617b544c11bc75a35c40b36185a2 (patch)
tree18da91858e4fded78a56d673fc69014fdf266676 /spec/unit/network/format.rb
parente31df2f7f5e98c524b68cd724cfaa3e308e7b9a1 (diff)
parentac5db5ec115455e54090542870847820357739a2 (diff)
downloadpuppet-bb23861e334e617b544c11bc75a35c40b36185a2.tar.gz
puppet-bb23861e334e617b544c11bc75a35c40b36185a2.tar.xz
puppet-bb23861e334e617b544c11bc75a35c40b36185a2.zip
Merge branch 'feature/master/1481'
This merges in the new fileserving code -- we're now using REST to do fileserving, rather than xmlrpc. Conflicts: lib/puppet/parameter.rb lib/puppet/type/file.rb spec/unit/type/file.rb
Diffstat (limited to 'spec/unit/network/format.rb')
-rwxr-xr-xspec/unit/network/format.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/unit/network/format.rb b/spec/unit/network/format.rb
index b960a3f73..244bff306 100755
--- a/spec/unit/network/format.rb
+++ b/spec/unit/network/format.rb
@@ -74,10 +74,27 @@ describe Puppet::Network::Format do
Puppet::Network::Format.new(:yaml).should_not be_supported(String)
end
+ it "should not consider a class supported unless the format is suitable" do
+ @format.expects(:suitable?).returns false
+ @format.should_not be_supported(FormatRenderer)
+ end
+
it "should always downcase mimetypes" do
@format.mime = "Foo/Bar"
@format.mime.should == "foo/bar"
end
+
+ it "should support having a weight" do
+ @format.should respond_to(:weight)
+ end
+
+ it "should default to a weight of of 5" do
+ @format.weight.should == 5
+ end
+
+ it "should be able to override its weight at initialization" do
+ Puppet::Network::Format.new(:foo, :weight => 1).weight.should == 1
+ end
end
describe "when converting between instances and formatted text" do