search for: model_test

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

2017 Jun 11
1
Memory leak in nleqslv()
...n up memory used in previous iterations. I believe I've isolated the/my issue in a small sample of code: library(nleqslv) cons_ext_test <- function(x){ rows_x <- length(x)/2 x_1 <- x[1:rows_x] x_2 <- x[(rows_x+1):(rows_x*2)] eq1<- x_1-100 eq2<-x_2*10-40 return(c(eq1,eq2)) } model_test <- function() { reserves<-(c(0:200)/200)^(2)*2000 lambda <- numeric(NROW(reserves))+5 res_ext <- pmin((reserves*.5),5) x_test <- c(res_ext,lambda) #print(x_test) for(test_iter in c(1:1000)) nleqslv(x_test,cons_ext_test,jacobian=NULL) i<- sort( sapply(ls(),function(x){object.siz...
2006 Aug 17
1
Any success with stubbing Net::HTTP::get?
...out Net::HTTP::get and just about flipped it was so cool: http://habtm.com/articles/2006/01/12/mocking-net-http-get. This is exactly what I needed and allowed me to right even more happy model tests. I made an http.rb in my test/mocks/test directory and added the suggested require line in my model_test.rb file. Now, he didn''t give the details on what the fixture should look like. No matter. I gave it a try anyway. And when I run ruby test/unit/model_test.rb I''m getting errors from /usr/lib/ruby/1.8/net/http.rb instead of from my stub file. I''m calling get from mod...
2011 Oct 15
0
shoulda installation troubles
...run bundle install, thus the gem is installed, and it is featured in the list running gem list --local. but whenever I add something like class ModelTest < Test::Unit::TestCase should_not allow_value("blah").for(:email) end in a testfile, running that test with ruby -Itest test/unit/model_test.rb I get an error undefined method `allow_value'' for ModelTest:Class Am I missing something? should I manually require shoulda? where and how? thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rai...