Permalink
Browse files

Support multibyte description

To out put file as "#{md5}.html"
  • Loading branch information...
1 parent 8296db9 commit c21408fd0216b88dba93a7c303e9199446ccbcb4 @mataki mataki committed Jul 9, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 lib/rspec_api_documentation/html_writer.rb
  2. +2 −1 spec/html_writer_spec.rb
@@ -73,7 +73,7 @@ def dirname
def filename
basename = description.downcase.gsub(/\s+/, '_').gsub(/[^a-z_]/, '')
- basename = URI.encode(description) if basename.blank?
+ basename = Digest::MD5.new.update(description).to_s if basename.blank?
"#{basename}.html"
end
View
@@ -49,7 +49,8 @@
let(:example) { group.example(label) {} }
it "should have downcased filename" do
- html_example.filename.should == URI.encode(label) + ".html"
+ filename = Digest::MD5.new.update(label).to_s
+ html_example.filename.should == filename + ".html"
end
end
end

0 comments on commit c21408f

Please sign in to comment.