Skip to content

Commit

Permalink
added specdoc format to opts, started adding spec for utf-8 strings i…
Browse files Browse the repository at this point in the history
…n model files
  • Loading branch information
adamico committed Mar 11, 2010
1 parent 99956b5 commit 5810d86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/annotate/annotate_models_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#encoding: utf-8
require File.dirname(__FILE__) + '/../spec_helper.rb'
require 'annotate/annotate_models'
require 'rubygems'
Expand Down Expand Up @@ -69,6 +70,12 @@ class FooWithMacro < ActiveRecord::Base
acts_as_awesome :yah
end
EOS
create('foo_with_utf8.rb', <<-EOS)
#encoding: utf-8
class FooWithUtf8 < ActiveRecord::Base
UTF8STRINGS = %w[résumé façon âge]
end
EOS
end
it "should work" do
klass = AnnotateModels.get_model_class("foo.rb")
Expand All @@ -78,6 +85,10 @@ class FooWithMacro < ActiveRecord::Base
klass = AnnotateModels.get_model_class("foo_with_macro.rb")
klass.name.should == "FooWithMacro"
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
1 change: 1 addition & 0 deletions spec/spec.opts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--format=specdoc
--colour

0 comments on commit 5810d86

Please sign in to comment.