spec/unit/network/formats_spec.rb in puppet-2.7.20 vs spec/unit/network/formats_spec.rb in puppet-2.7.21
- old
+ new
@@ -53,19 +53,19 @@
instances = [mock('instance')]
instances.expects(:to_yaml).returns "foo"
@yaml.render_multiple(instances).should == "foo"
end
- it "should intern by calling 'YAML.load'" do
+ it "should safely load YAML when interning" do
text = "foo"
- YAML.expects(:load).with("foo").returns "bar"
+ YAML.expects(:safely_load).with("foo").returns "bar"
@yaml.intern(String, text).should == "bar"
end
- it "should intern multiples by calling 'YAML.load'" do
+ it "should safely load YAML when interning multiples" do
text = "foo"
- YAML.expects(:load).with("foo").returns "bar"
+ YAML.expects(:safely_load).with("foo").returns "bar"
@yaml.intern_multiple(String, text).should == "bar"
end
end
describe "base64 compressed yaml", :if => Puppet.features.zlib? do
@@ -118,13 +118,13 @@
text = "foo"
@yaml.expects(:decode).with("foo").returns "bar"
@yaml.intern_multiple(String, text).should == "bar"
end
- it "should decode by base64 decoding, uncompressing and Yaml loading" do
+ it "should decode by base64 decoding, uncompressing and safely Yaml loading" do
Base64.expects(:decode64).with("zorg").returns "foo"
Zlib::Inflate.expects(:inflate).with("foo").returns "baz"
- YAML.expects(:load).with("baz").returns "bar"
+ YAML.expects(:safely_load).with("baz").returns "bar"
@yaml.decode("zorg").should == "bar"
end
it "should encode by compressing and base64 encoding" do
Zlib::Deflate.expects(:deflate).with("foo", Zlib::BEST_COMPRESSION).returns "bar"