Commit 5810d861 by Andrea

added specdoc format to opts, started adding spec for utf-8 strings in model files

parent 99956b59
#encoding: utf-8
require File.dirname(__FILE__) + '/../spec_helper.rb' require File.dirname(__FILE__) + '/../spec_helper.rb'
require 'annotate/annotate_models' require 'annotate/annotate_models'
require 'rubygems' require 'rubygems'
...@@ -69,6 +70,12 @@ EOS ...@@ -69,6 +70,12 @@ EOS
acts_as_awesome :yah acts_as_awesome :yah
end end
EOS EOS
create('foo_with_utf8.rb', <<-EOS)
#encoding: utf-8
class FooWithUtf8 < ActiveRecord::Base
UTF8STRINGS = %w[résumé façon âge]
end
EOS
end end
it "should work" do it "should work" do
klass = AnnotateModels.get_model_class("foo.rb") klass = AnnotateModels.get_model_class("foo.rb")
...@@ -78,6 +85,10 @@ EOS ...@@ -78,6 +85,10 @@ EOS
klass = AnnotateModels.get_model_class("foo_with_macro.rb") klass = AnnotateModels.get_model_class("foo_with_macro.rb")
klass.name.should == "FooWithMacro" klass.name.should == "FooWithMacro"
end end
it "should not complain of invalid multibyte char (USASCII)" do
klass = AnnotateModels.get_model_class("foo_with_utf8.rb")
klass.name.should == "FooWithUtf8"
end
end end
end end
--format=specdoc
--colour --colour
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment