[Nitro] Markup spec

Arne Brasseur arne at arnebrasseur.net
Mon Jul 23 16:17:08 EDT 2007


I found a minute to merge the markup spec and markup testcase.

One test fails.

     # FIXME : This test is converted from TC, it fails
     #         The call to expand simply strips the html
     #         returning "Hello World!"
     #         Either fix the code or fix the spec

     it "should convert < and > to &lt; and &gt; with #expand" do
       @t.send(:expand, "<p>Hello World!</p>").
	should == "&lt;p&gt;Hello World!&lt;/p&gt;"
     end

I pushed it to http://darcs.arnebrasseur.net/glycerin.

There are 17 tc's left that need to be converted :

   nitro/raw/test/

   22009 tc_controller_params.rb
    2648 tc_dispatcher.rb
    1376 tc_element.rb
    1067 tc_flash.rb
     921 tc_helper.rb
    2991 tc_render.rb
    1814 tc_router.rb
     727 tc_server.rb
    1817 tc_session.rb
    1370 tc_template.rb

   nitro/raw/test/nitro/compiler:

   1349 tc_client_morpher.rb

   nitro/raw/test/nitro/helper:

   6468 tc_feed.rb
   2155 tc_navbar.rb
    623 tc_pager.rb
   3532 tc_table.rb
    624 tc_xhtml.rb

   nitro/raw/test/nitro/util:

   1834 tc_encode_url.rb

I included the filesize just in case (you never know) anybody likes to 
join he/she can get a feel of how much work each file is.

Converting a file is easy if you know a little bit Test::Unit and RSpec. 
Move the file to the spec/ tree, removing the tc_ prefix (use darcs mv).

Begin the file with
require "script/lib/spec"

require "raw/whatever/you're/testing"

TestCase  becomes  describe "..." do
test_something  becomes  it "..." do
assert_...  becomes  should ...

As soon as a spec runs it's ok, better if you can make it pass, but if 
you're not sure how to make it pass simply leave it like that. Jo will 
gladly look at it, and possibly pass it on to G.

(ab)

-- 
Arne Brasseur
http://www.arnebrasseur.net
arne at arnebrasseur.net


More information about the Nitro-general mailing list