[Nitro] OG and ruby-dbi

Jonathan Buch john at oxyliquit.de
Tue Aug 28 21:11:21 EDT 2007


Hi,

> I'd prefer to answer specific questions to be honest, because I'm a bit
> swamped at the moment. Can you post fragments of the humungous testcase
> and I can see if I can help?

ah of course, sorry.  :)

Example assertion:

   def assert_request_good(url, value, message = nil)
     result = handle_request(url, value)

     message = build_message(message, "<?> returned error. \nResult: ?\nInstead of: ?", url, result, value)

     assert_block message do
       if result =~ /error/
         false
       else
         cmp(value, eval(result))
       end
     end
   end


Example usage:

   def test_mixed
     tests = {
       '/single/foo?first=one&second=two' => {
         :action => :single,
         :params => {'first' => 'one', 'second' => 'two'},
         :arguments => ['foo']
       }
     }

     tests.each do |url, value|
       assert_request_good url, value
     end
   end

That's basically it, it's a huge amount of tests, all using the
assert_request_good / assert_request_bad methods.  Now those would
somehow have to be 'specified' or removed, depending on how that
stuff would be best handled by RSpec.


I hope that is more 'answerable'.  :)

Jo

-- 
Feel the love
http://pinkjuice.com/pics/ruby.png


More information about the Nitro-general mailing list