summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-20 12:11:52 -0500
committerLuke Kanies <luke@madstop.com>2008-08-20 12:11:52 -0500
commit4f275b669b0336c6032204bfa9694fa6522eb267 (patch)
tree72fdd0d5ff938534e65a63bd83839df2ac1f6ddf
parente3971b9751141cd448a8197da024be43581f6dcd (diff)
downloadpuppet-4f275b669b0336c6032204bfa9694fa6522eb267.tar.gz
puppet-4f275b669b0336c6032204bfa9694fa6522eb267.tar.xz
puppet-4f275b669b0336c6032204bfa9694fa6522eb267.zip
Fixing #1514 - format tests now work again.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rwxr-xr-xspec/unit/network/formats.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/unit/network/formats.rb b/spec/unit/network/formats.rb
index 1baf72597..d5967c6f2 100755
--- a/spec/unit/network/formats.rb
+++ b/spec/unit/network/formats.rb
@@ -92,42 +92,42 @@ describe "Puppet Network Format" do
describe "plaintext" do
before do
- @text = Puppet::Network::FormatHandler.format(:str)
+ @text = Puppet::Network::FormatHandler.format(:s)
end
it "should have its mimetype set to text/plain" do
@text.mime.should == "text/plain"
end
- it "should fail if the instance does not respond to 'to_str'" do
+ it "should fail if the instance does not respond to 'to_s'" do
instance = mock 'nope'
- instance.expects(:to_str).never
+ instance.expects(:to_s).never
lambda { @text.render(instance) }.should raise_error(NotImplementedError)
end
- it "should render by calling 'to_str' on the instance" do
- # Use an instance that responds to 'to_str'
+ it "should render by calling 'to_s' on the instance" do
+ # Use an instance that responds to 'to_s'
instance = "foo"
- instance.expects(:to_str).returns "string"
+ instance.expects(:to_s).returns "string"
@text.render(instance).should == "string"
end
- it "should render multiple instances by calling 'to_str' on each instance and joining the results with '\\n---\\n'" do
+ it "should render multiple instances by calling 'to_s' on each instance and joining the results with '\\n---\\n'" do
instances = ["string1", 'string2']
@text.render_multiple(instances).should == "string1\n---\nstring2"
end
- it "should intern by calling 'from_str' on the class" do
+ it "should intern by calling 'from_s' on the class" do
text = "foo"
- String.expects(:from_str).with(text).returns "bar"
+ String.expects(:from_s).with(text).returns "bar"
@text.intern(String, text).should == "bar"
end
it "should intern multiples by splitting on '\\n---\\n' and converting each string to an instance" do
text = "foo\n---\nbar"
- String.expects(:from_str).with("foo").returns "FOO"
- String.expects(:from_str).with("bar").returns "BAR"
+ String.expects(:from_s).with("foo").returns "FOO"
+ String.expects(:from_s).with("bar").returns "BAR"
@text.intern_multiple(String, text).should == ["FOO", "BAR"]
end
end