similar to: assert_raises --> how does it work?

Displaying 20 results from an estimated 1000 matches similar to: "assert_raises --> how does it work?"

2006 May 17
0
teardown not cleaning the BD?
Hi, I am a bit confused, I have a few functionnal tests were I add/delete records on top of the ones provided in the fixture and it seems like the records are surviving the teardown. Isnt teardown supposed to be ran after each test? So if I have something like: def teardown Client.delete_all Concept.delete_all Variation.delete_all ClientVariation.delete_all end All the
2004 Feb 01
2
test_services test case
While working on win32-service-0.3.0 I got hung up trying to resolve that "RPC server is unavailable" error message that was popping up on some systems. I couldn''t duplicate this on my XP Pro box, but it does show up on my Win2k box. Quick review - this is the test case from tc_service.rb def test_services assert_nothing_raised{ Service.services{ } }
2006 Feb 08
1
functional test problem
I am trying to write a test for my delete method. I find a User in the db by its id, do the delete action, then I want to see if it is still in the db. How do I check that the User IS Deleted without causing errors? ** My Test ******************************** def test_delete_user login user = User.find(2) post :delete_user, {:id => user.id} assert_equal "User
2012 Feb 23
1
Bug in nested_attributes_for: question about best way to patch
I''ve discovered what I''m pretty confident is unexpected behavior in accepts_nested_attributes_for, and am developing a patch, but I''ve encountered a question about how the core team would prefer the implementation to look. Here''s the bug: when assigning to a belongs_to relationship (and I believe one-to-one, but I haven''t verified yet) if you mark the
2006 Nov 22
1
Using assert_raise
When Im writing tests and I do: assert_raise RuntimeError, raise("raising") Then I run the test is says the test failed and I have 1 error: RuntimeError: hey Should assert_raise catch that error and say the test passed? Thanks for your time and help. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because
2006 Jan 28
1
Unit Tests Behavior
Hi, Working on unit tests and I have a few cascade delete constraints I am testing. The unit tests stop at the first assert_raise test. Is this typical? def test_destroy_all_cascade_delete assert_equal 1, Iep.find(:first).client_id assert_equal 1, Encounter.find(:first).client_id @client.destroy assert_raise(ActiveRecord::RecordNotFound) { Iep.find(1) } <--
2009 Apr 23
2
R 2.9 binaries for redhat entreprise 4 / X86_64
Hi everybody. I'd like to ask if someone could tell me when the binaries for R 2.9 / redhat entreprise 4 / X86_64 will be available ? I don't need a precise date but some indication like 1 month, 6 month, never ? Thank you for any help. Mathieu --- Mathieu Van der Haegen Machine Learning Group Université Libre de Bruxelles [[alternative HTML version deleted]]
2008 Oct 24
1
rescue_from and assert_raise
Since commit 5e3517ea7b9fbd460f772bffc9212d882011f2bc, rescue_from is now being handled in tests. I''ve been using rescue_from to handle custom exceptions and testing that those exceptions are raised in functional tests with assert_raise. This no longer works now. What''s the proper way to test this now? --~--~---------~--~----~------------~-------~--~----~ You received this
2011 Mar 15
2
How do you distribute ruby-augeas for ruby-entreprise?
We are using ruby-entreprise, instead of redhat''s default ruby.... I was trying to deploy the needed gem using: /opt/ruby-enterprise/bin/gem install --no-rdoc --no-ri /tmp/ruby-augeas-0.3.0.gem But found out this would require gcc to be installed! How can I preb-build this gem to remove the need for gcc on the nodes? is there an option of the gem command to generate a distributable
2006 Jun 01
1
find not working properly
here is the input view [code] <form method="post" action="found"> <br> <b>Find by</b><br/> <b>Vehicle Number:</b><br/> <input id="truck_vehicleID" name="truck[vehicleID]" size="20" type="number" value=""/><br/> </p> <%= link_to "Find", :action
2012 Nov 30
1
compiling R for Windows 64 bit
Dear All, I'm trying to compile R for Windows 64 bit. I'm following the instructions of R installation and administration guide v2.15.2 (3.1; A.3.1.4; C.2.2) and at the moment I compiled the default version (single threaded, gcc, without external BLAS) ?on my notebook (windows xp 32 bit) Now I'm trying to compile it on Windows servers 64 bit with the next configuration : 1. Windows
2008 Oct 02
2
samba : Strong(er) authentication required
Good morning I am running a windows server 2003 AD domain where the option "server signing" cannot be changed I have installed the latest version of samba and i always get this error msg " Failed to join domain : Strong(er) authentication required" Kinit is working net ads join -U xxxxxx -d4 does give above error message Is there a solution for this ? It seems lots of person
2006 Jul 18
2
Testing which RuntimeError is raised
I am just starting to use unit testing. Way cool. But I am not finding very clear docs on assert_raise. I have managed to write a test that tells me that the destroy I am trying to test fails with a RuntimeError (as it should). However, I would really like to test that it rails for the specific reason I have in my model. How can I get more specific? Am I going to have to create my own exception
2006 May 29
8
Rails and user authentification
I am a the point now where I have to add user authentification to my application. Anyone can point me toward an easy to use / secure library? I know about ActiveRBAC and was wondering if there is anything else that I should consider. Thanks! -- Posted via http://www.ruby-forum.com/.
2004 Apr 28
9
chan_sip.c max number of retries?
Still getting the same error. Apr 29 11:57:49 WARNING[1125329600]: chan_sip.c:503 retrans_pkt: Maximum retries exceeded on call 6b8b4567327b23c6643c986966334873@211.28.255.135 for seqno 102 (Critical Request) please advise anyone!!!!!someone!!! jai
2006 Nov 24
6
Rails 1.2 RC1 problem
Hi Have this helper method inside a sites_helper.rb module def distritos [ ['0', 'Todos'], ['1', 'Aveiro'], ['2', 'Beja'], ['3', 'Braga'], ['4', 'Brangança'], ['5', 'Castelo Branco'], ['6', 'Coimbra'], ['7',
2008 Feb 13
5
Example controller spec no worky?
I''m trying to spec a dead simple "show non-existent record should render 404" case, but it seems the RecordNotFound exception is making it impossible for some reason. #controller def show @event = Event.find(params[:id]) end #spec - pretty much straight from the rspec site before do Event.stub!(:find) get :show, :id => ''broken'' end #
2002 Feb 23
2
XFS ACLs vanish. (2.2.2a and 2.2.3a)
Hiya. I've got an XFS partition, have compiled and installed all the XFS stuff, then compiled (with --with-acl-support) samba, which then returns: checking whether to support ACLs... checking for acl_get_file in -lacl... yes checking for ACL support... yes Using posix ACLs So it would seem to me that ACLs would be supported. So then I install and run it, add the box to the (Samba 2.2.2)
2007 Dec 22
8
Rails 2.0 rescue_from
I am trying to use the new Rails 2.0 macro : rescue_from class PostsController < ApplicationController rescue_from ActiveRecord::RecordNotFound, :with => :deny_access ... def show @post = Post.find_by_id(params[:id]) raise ActiveRecord::RecordNotFound if @post.nil? #illegal access ..... end def deny_access respond_to do |format| format.html end end but the
2004 Apr 06
1
No default printer found
Dear all, I have troubles to get the printing working in wine. I have downloaded Wine 20040309 and installed from sratch with ./tools/wineinstall Everthing seems to work fine except the printning: notepad gives: fixme:commdlg:PRINTDLG_SetUpPrinterListComboW Can't find '(null)' in printer list so trying to find default fixme:commdlg:PRINTDLG_SetUpPrinterListComboW Can't find