Kouhei Sutou
kous****@users*****
2006年 11月 30日 (木) 11:53:15 JST
Index: tomoe/test/char_spec.rb diff -u tomoe/test/char_spec.rb:1.5 tomoe/test/char_spec.rb:1.6 --- tomoe/test/char_spec.rb:1.5 Thu Nov 30 11:22:31 2006 +++ tomoe/test/char_spec.rb Thu Nov 30 11:53:15 2006 @@ -31,14 +31,13 @@ end specify "should set/get variant" do - variant = Tomoe::Char.new - variant.n_strokes = 5 + variant = "ç°" char = Tomoe::Char.new char.variant.should_nil char.variant = variant - char.variant.n_strokes.should == 5 + char.variant.should == variant end specify "should set/get writing" do @@ -75,23 +74,16 @@ end specify "should add/get radical" do - radical1 = Tomoe::Char.new - radical1.n_strokes = 5 - - radical2 = Tomoe::Char.new - radical2.n_strokes = 10 + radical1 = "æ¨" + radical2 = "æ°´" char = Tomoe::Char.new char.radicals.should_empty char.add_radical(radical1) - char.radicals.collect do |radical| - radical.n_strokes - end.sort.should == [radical1.n_strokes] + char.radicals.sort.should == [radical1] char.add_radical(radical2) - char.radicals.collect do |radical| - radical.n_strokes - end.sort.should == [radical1.n_strokes, radical2.n_strokes].sort + char.radicals.sort.should == [radical1, radical2].sort end end Index: tomoe/test/tomoe-spec-utils.rb diff -u tomoe/test/tomoe-spec-utils.rb:1.13 tomoe/test/tomoe-spec-utils.rb:1.14 --- tomoe/test/tomoe-spec-utils.rb:1.13 Wed Nov 29 15:51:26 2006 +++ tomoe/test/tomoe-spec-utils.rb Thu Nov 30 11:53:15 2006 @@ -26,6 +26,14 @@ class Context include TomoeSpecSetup end + + module Formatter + class ProgressBarFormatter + def format_backtrace(backtrace) + super(backtrace.collect {|bt| bt.sub(/\A([^:]+:\d+)$/, '\\1:')}) + end + end + end end end