similar to: Rspec: How to mock class method

Displaying 20 results from an estimated 1000 matches similar to: "Rspec: How to mock class method"

2008 Feb 02
1
Ruby++ FFI (theoretical)
Hi all, How does this look as a potential FFI for our theoretical Ruby++ ? I''m not sure how to do mixins, though. Some sort of special directive? Or just add it to inheritance chain? Anyway, this is just a rough prototype. No attempt at an actual implementation yet. Regards, Dan // foo.h - Function prototypes #define _FOO_H_ using namespace ruby; // Subclass Object class Foo :
2006 Feb 15
2
extending rails via /lib - problems
I wanted to group some functions which I use in some models in one place. Controllers have application.rb and views have helpers but I couldn''t find anything about models. Using the /lib directory seemed to be the only way. Alright... so I have something like this: /lib/code.rb class ActiveRecord::Base def method_a(n) ....... end def method_b(n) ........ end end
2006 Jul 12
5
SystemStackError
SystemStackError in GreyController#grey_search stack level too deep can anybody please enlighten me on this one...any possible way to troubleshoot? thanks, MSN id: ICEMANyears@netscape.net -- Posted via http://www.ruby-forum.com/.
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
Hi all, I feel like I''m missing something really easy and I''m just not seeing it. I''m using the restful_authentication plugin and have a User model. Uesr has_many :things and Thing belongs_to :user. That''s it. I did a "script/generate rspec_scaffold thing" to generate all the necessary bits. The "rake db:migrate" to create the db. At
2011 Aug 02
1
Rspec teting API.
Hi! Guys, I wanna test an API built in Rails 3.0.3. So, my question is... What''s the better way to test my own api? I guess that a requests specs like these: describe ''POST /client'' it ''works'' do assert_difference post ''/clients'', :client => {...} end end can be appropriate... Someone just tested an API? I mean... simulate
2013 Mar 07
1
Should ActiveRecord::RecordNotSaved attach the record in question?
I''m doing some work where I want to rescue ActiveRecord::RecordNotSaved from a save! call nested deep in the code. The thing is there could theoretically be failures here I want to pass through, and I want to inspect the record in order to decide. I figure a custom initializer on the exception class and a couple quick patches here and there in the code would make it minimally
2008 Mar 11
4
Graphing question (multiple line graphs arranged spatially)
station month bas 190 5 0.000 190 7 1.563 190 10 0.000 190 11 0.000 202 4 18.750 202 5 18.750 202 7 6.250 202 10 4.800 202 11 3.125 198 4 18.750 198 5 31.250 198 7 3.125 198 10 3.200 198 11 12.500 205 4 0.000 205 5 0.000 205 7 0.000
2011 Sep 09
3
Missing Content-Length header breaks ActiveResource 3.1 on create
Hi, I''ve recently moved a 3.0 app ta 3.1 and am finding that ActiveResource breaks after a successful post because we now check for the presence of the Content-Length header[1] after a successful create (basically whenever the API returns a 201). The API is also on 3.1, and this only happens on staging/pre-prod/prod. I''m still investigating, but one thing that is clear is that
2006 Mar 06
2
getting lock error
I'm getting this error for al my users does anybody know wat the problem is and how i can fix it pop3(bas at giskit.nl): Mar 06 09:10:37 Error: file_wait_lock() failed with index file /mailstore/vmail/giskit.nl/bas/.INBOX/.imap.index: No locks available Met vriendelijk groet, Bas van Dikkenberg GISkit bv BFVD1-RIPE Tel: +3130-6340430 Fax:
2005 Jun 09
4
Lingo(.com) and Asterisk
Hello, A long Google search didn't turn any clear answer. Does somebody use Asterisk in combination with Lingo? Thank you, Bas
2008 Oct 31
2
FW: nfs troubles
Hi all, I upgraded to dovecot 1.1.6 to be able to use NFS. Got a little issue: I can't move mail to another IMAP folder (so I can't delete to: moving to .trash does not work. Error message Oct 31 11:07:45 jozua-mailserver dovecot: IMAP(nicolette at kerknet.org): fdatasync_path(/var/mail/kerknet.org/nicolette/Maildir/.Trash/cur) failed: Invalid Argument I tried to use ll
2002 Jun 16
3
lm() function to get coefficients doesn`t work
Hi, to get the residuals and coefficients I did the following: kurse <- read.table("kurse.txt" header=T) the data: index bmw mru rwe vow kar sie bas 1 159,70 74,18 338,21 89,03 110,30 141,23 178,53 67,97 2 160,76 73,46 343,66 89,38 110,30 142,66 180,45 68,30 3 162,45 74,18 349,12 91,54 108,54 146,22 183,12 68,85 4 162,18 72,74 349,12 92,20 106,43 144,80 181,75
2007 Feb 23
1
Receive more information about transfer problems in server log?
Hi all, I'm probably using the most basic rsync-setup: just running the rsync-daemon and use plain transfers (no encryption or other shells, plain rsync). Transfer logging is enabled. I've got a lot of client machines rsyncing their backups, both Linux and Windows. For some rsyncs, the log tells me this: > 2007/02/23 02:42:04 [29077] connect from ***.nl (*.*.*.*) > 2007/02/23
2007 Mar 29
1
mongrel and vista
Thanks for your reply Luis > Will be very helpful if you provide the logs (servicefb.log and > mongrel_service.log) both located into ruby\bin directory. --------------------------------------------------------------------------------- # Logfile created on 28/03/2007 17:54:32 native/process.bas:44, fb.process.spawn: Spawn() init native/process.bas:50, fb.process.spawn: Success in
2006 Mar 02
2
ipv6 not working
I added an listner to dovecot bye adding the following lines to config but no result no connectivity with ipv6: imap_listen = [::] pop3_listen = [::] imap_listen = * pop3_listen = * Met vriendelijk groet, Bas van Dikkenberg GISkit bv BFVD1-RIPE Tel: +3130-6340430 Fax: +3130-6342433 Prive Tel: +3130-6372769 Mob:
2006 Dec 11
3
Filter logging
Hi, I have question i have loadbalancer that's connects every x seconds to my pop3 and Imap to see if it's still working. Every time it connects I see its ip is there a way to say don't log ip x.x.x.x ? With kind regards, Bas van den Dikkenberg -------------- next part -------------- An HTML attachment was scrubbed... URL:
2014 Apr 17
2
[LLVMdev] [lld] LLD's software architecture
Hi, I'm analysing the LLD code structure (aka architecture) and am trying to mold it into a component model. Currently I see 4 components: - Driver - ReaderWriter - Passes - Core I wonder if this is the order that they're supposed to be in, since there are also code dependencies upwards from: Core -> ReaderWriter Passes -> ReaderWriter ReaderWriter -> Driver For a
2002 Jun 19
2
solve() doesn`t work
Hi, I tried to inverse a matrix but it doesn`t work. I hope somebody can help me. This is what I did. > kurse <- read.table("kurse.txt", header=T, dec=",") > x <- cbind(1,kurse[,-c(1)]) > y <- kurse$index > t(x) %*% x Error in t(x) %*% x : requires numeric matrix/vector arguments > x <- as.matrix(x) > xtxi <- solve(t(x) %*% x) Error in
2013 Jul 17
5
Why last doesn't return an ActiveRecord::Relation
Hello, Sorry if this has been still answered, I haven''t found nothing on it. I would love to know why ActiveRecord::Base#last doesn''t return an ActiveRecord::Relation just like all or where since an ActiveRecord::Relation can act more or less like an array (as specified here<https://github.com/rails/rails/commit/0a6833b6f701c8c8febadfe2f45e25df29493602> )? Thanks, have
2006 Dec 21
1
multinom(nnet) analogy for biglm package?
I would like to perform a multinomial logistic regression on a large data set, but do not know how. I've only thought of a few possibilities and write to seek advice and guidance on them or deepening or expanding my search. On smaller data sets, I have successfully loaded the data and issued commands such as: length(levels(factor(data$response))) [1] 6 # implies polychotomy library(nnet)