summaryrefslogtreecommitdiffstats
path: root/spec/unit/network/format.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-03-23 13:43:38 -0500
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitb41d53596cdcb6d7220b93926f6eedf171c09c46 (patch)
treef7616b6197520fdb5f96fe37aa955518d7b26978 /spec/unit/network/format.rb
parent7504f1ede94900ab42cd6e9c4ff9c8a5cb9e65ee (diff)
downloadpuppet-b41d53596cdcb6d7220b93926f6eedf171c09c46.tar.gz
puppet-b41d53596cdcb6d7220b93926f6eedf171c09c46.tar.xz
puppet-b41d53596cdcb6d7220b93926f6eedf171c09c46.zip
Adding filename extension support to formats.
This is toward fixing #1943 - we need the ability to easily convert between file extensions and file formats. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/network/format.rb')
-rwxr-xr-xspec/unit/network/format.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/network/format.rb b/spec/unit/network/format.rb
index e5a6b599c..73530b9d7 100755
--- a/spec/unit/network/format.rb
+++ b/spec/unit/network/format.rb
@@ -123,6 +123,13 @@ describe Puppet::Network::Format do
Puppet::Network::Format.new(:foo, :weight => 1).weight.should == 1
end
+ it "should default to its extension being equal to its name" do
+ Puppet::Network::Format.new(:foo).extension.should == "foo"
+ end
+
+ it "should support overriding the extension" do
+ Puppet::Network::Format.new(:foo, :extension => "bar").extension.should == "bar"
+ end
[:intern_method, :intern_multiple_method, :render_multiple_method, :render_method].each do |method|
it "should allow assignment of the #{method}" do
Puppet::Network::Format.new(:foo, method => :foo).send(method).should == :foo