spec/build_spec.rb in hemingway-0.0.2 vs spec/build_spec.rb in hemingway-0.0.3

- old
+ new

@@ -37,10 +37,14 @@ it 'should generate a tag with content and an id and a class and an href' do Build.tag(attribute, content, :id => id, :class => klass, :href => href).should == "<#{attribute} id='#{id}' class='#{klass}' href='#{href}'>#{content}</#{attribute}>" end + it 'should generate a tag with content and a src and no closing tag' do + Build.tag("img", nil, :src => "/assets/vibes.png", :close_tag => false).should == "<img src='/assets/vibes.png'>" + end + # Can't wait for Ruby 2.0 it 'should generate a tag with content and a class and no content' do Build.tag(attribute, nil, :class => klass).should == "<#{attribute} class='#{klass}'></#{attribute}>" end @@ -54,9 +58,22 @@ let(:symbol) { "\\Delta" } it 'should translate the Latex symbol into an html equiavalent' do Build.symbol(symbol).should == "&Delta;" + end + + end + + describe "#accent" do + + it 'should convert an accent and character into the html equivalent' do + Build.accent("A", "`").should == "&Agrave;" + end + + it 'should leave the character untouched if no equiavalent exists' do + Build.accent("G", "`").should == "G" + Build.accent("C", "~").should == "C" end end end \ No newline at end of file