spec/parse_attributes.rb in slippers-0.0.11 vs spec/parse_attributes.rb in slippers-0.0.12
- old
+ new
@@ -1,5 +1,6 @@
+# coding:utf-8
require File.dirname(__FILE__) + '/spec_helper'
describe SlippersParser do
before(:each) do
@@ -39,16 +40,16 @@
end
it "should render the default string when the attribute cannot be found on the object to render and there is no template group" do
Slippers::Engine::DEFAULT_STRING.should eql('')
@parser.parse("This is the $adjective$ template with $message$.").eval(OpenStruct.new).should eql("This is the template with .")
- @parser.parse("$not_me$").eval(:object).should eql('')
+ @parser.parse("$not_me$").eval(stub()).should eql('')
end
it "should render the default string of the template group when the attribute cannot be found on the object to render" do
template_group = Slippers::TemplateGroup.new(:default_string => "foo" )
template_group.default_string.should eql('foo')
- @parser.parse("$not_me$").eval(:object, template_group).should eql('foo')
+ @parser.parse("$not_me$").eval(stub(), template_group).should eql('foo')
end
it "should convert attribute to string" do
fred = OpenStruct.new({:name => 'fred', :dob => DateTime.new(1983, 1, 2)})
template_group = Slippers::TemplateGroup.new(:templates => {:date => Slippers::Engine.new('$year$')} )