search for: footest

Displaying 9 results from an estimated 9 matches for "footest".

Did you mean: foo_test
2006 Mar 07
3
STI and unit testing
...models to try and get my head round it but I''m still struggling. I''m using STI and trying to write tests for the extended models (code below). I''ve written test cases for the extended models which themselves extend the test case for the parent model, so BarTest extends FooTest which extends TestCase when I run ''bar_test.rb'' it seems to run the test case twice, once for FooTest and once for BarTest, even though the only file I''m running is bar_test.rb - here''s the output: C:\WINDOWS\system32\cmd.exe /c ruby bar_test.rb Loaded suite...
2003 Jan 20
1
R and gdb
Hi, I have some problem with setting breakpoints with gdb in order to debug some shared library for R. Classical use of gdb work well gcc -g -o footest.o footest.c gdb footest.o b 2 run ... but as i tried to use it with R : $ R -d gdb GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions....
2007 Nov 13
5
how to ensure signature compliance while mocking in ruby
On 13/11/2007, Pradeep Gatram <pradeep.gatram at gmail.com> wrote: > > Let me put my dilemma as an example. Take a look at a snippet from > FooTest. > > #using mocha > def test_method1 > Bar.expects(:method2).with(''param1'', ''param2'').once > Foo.method1 > end > > And now the implementation > > class Foo > def self.method1 > Bar.method2(''param1'',...
2007 Dec 24
1
Uninitialized constant in integration test
...I have tried requiring both ''application'' and ''listings_controller'', but neither solves this problem, although the exception changes. Anybody know what''s going on here? Thanks. ---- require "#{File.dirname(__FILE__)}/../test_helper" class FooTest < ActionController::IntegrationTest def test_redirect get "/" assert_redirected_to "/" end end ---- with this exception: NameError: uninitialized constant ApplicationController /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/depend...
2006 Mar 30
2
database.yml and Dreamhost
...iven by socket instead. port: 3306 # Warning: The database defined as ''test'' will be erased and # re-generated from your development database when you run ''rake''. # Do not set this db to the same as development or production. test: adapter: mysql database: footest username: fooadmin password: **** host: test.foo.com port: 3306 production: adapter: mysql database: fooprod username: fooadmin password: **** host: prod.foo.com port: 3306 # PostgreSQL versions 7.4 - 8.1 # # Get the C bindings: # gem install postgres # or use the pure-Ruby...
2007 Nov 07
1
Helper methods starting with should_ get picked up as examples?
Hi! I recently updated my rspec and rspec_on_rails plugins to the tip of the trunk and ran into an issue with helper methods with names starting with should_ in my describe blocks. Fictive example to show what I''m talking about: describe Order do it "Can be paid for" do ... should_have_paid(user) end def should_have_paid(user) end end I know in
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
2007 Mar 18
5
Automatically mocking ActiveRecord methods
Seems like I do a fair amount of mocking ActiveRecord''s automatically generated routines when I''m testing controllers. Things like: @portalspace = PortalSpace.new :public_readable => true, :public_writable => true, :name => ''public'' @portalspace.stubs(:id).returns(203) PortalSpace.stubs(:find).with(203).returns(@portalspace)
2007 Jun 11
12
Mocking system/`
This drives me insane on a regular basis. How does one mock system(''blah'') or `blah` ? Adding expectations on Kernel doesn''t do it. Adding expectations on Object just makes me sad: Object.any_instance.expects(:system).with(''ls'') # => #<Mock:0x12b584e>.system(''ls'') - expected calls: 0, actual calls: 1 And this really