summaryrefslogtreecommitdiff
path: root/spec/unit/formatters
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-05-30 13:38:32 -0700
committersersut <serdar@opscode.com>2013-05-30 13:44:50 -0700
commit32172b48de16b884a539ee4358b52d711f86b368 (patch)
tree79613bb71025a7a46f4b8ce8b868e6d56a628e44 /spec/unit/formatters
parentaeee4bf96582769207780311b7b882c387656567 (diff)
downloadchef-32172b48de16b884a539ee4358b52d711f86b368.tar.gz
Make sure that windows line endings are protected during template rendering.
Diffstat (limited to 'spec/unit/formatters')
-rw-r--r--spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb
index fa96845aca..b6d48d0255 100644
--- a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb
+++ b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb
@@ -83,14 +83,15 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
@description = Chef::Formatters::ErrorDescription.new("Error Converging Resource:")
@template_class = Class.new { include Chef::Mixin::Template }
@template = @template_class.new
- @context = {:chef => "cool"}
+ @context = Chef::Mixin::Template::TemplateContext.new({})
+ @context[:chef] = "cool"
@resource = template("/tmp/foo.txt") do
mode "0644"
end
@error = begin
- @template.render_template("foo\nbar\nbaz\n<%= this_is_not_defined %>\nquin\nqunx\ndunno", @context) {|r| r}
+ @context.render_template_from_string("foo\nbar\nbaz\n<%= this_is_not_defined %>\nquin\nqunx\ndunno")
rescue Chef::Mixin::Template::TemplateError => e
e
end