search for: test_my_method

Displaying 3 results from an estimated 3 matches for "test_my_method".

2006 Apr 14
8
Error with Web Service tests after upgrading to Rails 1.1.2
...the problem, I scaffolded a simple Web Services Controller: % ./script/generate web_service Problem my_method Running the test on this Controller, I get: % ruby test/functional/problem_api_test.rb Loaded suite test/functional/problem_api_test Started E Finished in 0.047129 seconds. 1) Error: test_my_method(ProblemControllerApiTest): NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.length /usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/test_invoke.rb:55:in `encode...
2007 Jul 16
4
Set the return value to "same as block"
It would be good to be able to set the return value to be the same as the return value of the block. I am trying to test opening a file in a block and reading from it. It would be nice to use code like this: object.stubs(:open).with("/path/to/file", "r").yields( stub(:read => "The file contents") ).returns(from_block) Which would make open() take the return
2006 May 13
9
Is test driven development for newbies?
I''m still reading other people''s code and going over the books. As I was doing this a question sprang up in my mind. Is it wise for total newbies to attempt test driven development from the start? Basically, if you''re a newbie like me, chances are your tests might even be broken themselves. Or will attempting to write tests be good practice for actual coding as