similar to: Stubbing constructiors

Displaying 20 results from an estimated 1000 matches similar to: "Stubbing constructiors"

2006 Dec 14
2
public SVN dead?
James Mead wrote: > Trunk has moved on considerably since the last release. I really must > get round to releasing again soon. Righty, right. I''ve tried: svn checkout svn://rubyforge.org/var/svn/mocha as documented here [1], but svn will just hang forever. Accessing any of the following: [svn|http[s]]://rubyforge.org/var/svn/mocha[/[trunk[/]]] either through the svn
2007 Jan 11
4
counter-intuitive behaveour when passing a proc to Mocha::Expectation#returns
Let''s say that I have a procedure that: * gets the number of bytes to write into some file * and returns the number of successfully written bytes def save( text, len ) This procedure is being used all over the place especially inside the method "process" which I want to test. Thus in order not to polute my filesystem I stub the "save" procedure. But of course in
2006 Dec 13
1
Mocha: and there''s an "init.rb" in the SVN too
Sorry for the spam avalanche - there''s an init.rb file in the trunc SVN branch too, which I''m not so sure about whether to include it or not in the Debian package... *t ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
2006 Dec 13
1
published Mocha tarball is missing the expamples/ dir
Hello James, am trying to package Mocha for Debian and have noticed, that both the tarball and the zip are missing the examples/ directory. *t ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
2006 Nov 21
5
stubbing in development environment
Hi guys. Quite happy with mocha for testing. It''s been a bit of an eye opener for me, and I expect to begin using it heavily. One other thing I''d like to do is stub out particular class methods in development. Is there a way I can do this with mocha? Jason
2006 Sep 25
3
Problem stubbing instances referred to by constants
Hi James, An instance retains its mocha between tests if that instance is pointed to by a constant. The simplest failing test is something like (add as a new file in mocha/test).. #--code-- require File.join(File.dirname(__FILE__), "test_helper") require ''stubba'' class WemStubbaTest < Test::Unit::TestCase Arr = [1, 2, 3] def test_a
2006 Nov 10
3
Stubbing Time.now in trunk
I''m a big fan of stubbing Time.now so it returns a known value. I used to be able to use stubba and say: @time_now = Time.parse("Jan 1 2001") Time.stubs(:now).returns(lambda{@time_now}) However, something in trunk broke that. Fine, rspec''s got its own stubbing lib now, so I tried switching to that: @time_now = Time.parse("Jan 1 2001")
2006 Sep 13
2
Problem with RSpec and Mocha/Stubba
I''ve recently upgraded to the latest versions of Mocha and RSpec (0.3.2 and 0.6.3 respectively) and I''m no longer able to use Mocha/ Stubba with RSpec. Its actually only Stubba I''m interested in as I use RSpec''s built-in mocking library. I require stubba in my spec file but whenever I try and run my spec it fails with the error: Unintialized constant
2014 Feb 21
6
[LLVMdev] make check issue with llvm-cov
rkotler at mipsswbrd006-le:~/caviumllvm/build/test$ make Making LLVM 'lit.site.cfg' file... Making LLVM unittest 'lit.site.cfg' file... ( ulimit -t 600 ; ulimit -d 512000 ; ulimit -m 512000 ; ulimit -s 8192 ; \ /usr/bin/python /home/rkotler/workspace/llvm/utils/lit/lit.py -s -v . ) XPASS: LLVM :: tools/llvm-cov/llvm-cov.test (8916 of 9784) ******************** TEST
2007 Jan 24
0
Mocha 0.4 released
So I finally got round to releasing a new version<http://rubyforge.org/frs/?group_id=1917&release_id=9184>of Mocha <http://mocha.rubyforge.org/>. Much of the functionality has been available for some time if you''ve been using the Rails plugin based on subversion HEAD, but now you can get it in all in a gem (or other package). The most recent changes centre around allowing
2012 Apr 24
1
Use of optim to fit two curves at the same time ?
Dear list, Here is a small example code that use optim and optimize in order to fit two functions. Is it possible to fit two functions (like those two for example) at the same time using optim ... or another function in R ? Thanks Arnaud ###################################################################### ## function 1 x1 <- 1:100 y1 <- 5.468 * x + 3 # + rnorm(100,0, 10) dfxy <-
2006 Oct 04
3
do we need stubbing?
Hey all - The trunk currently supports three types of mocking/stubbing: Mock Objects (created dynamically at runtime) Partial Mocking of methods on existing classes Stubbing of methods on existing objects or classes The main difference between Partial Mocking and Stubbing is that Stubs don''t verify. I''m wondering if we really need the stubbing facility at all, given that we
2006 Oct 25
5
Mocha, Stubba and RSpec
Hi, I''ve been reading with interest the threads trying to integrate Mocha and Stubba with RSpec. So far, I''ve made the two changes in spec_helper.rb suggested, but discovered another one that neither of the archives mentions: If you use traditional mocking: object = mock or the stub shortcut : object = stub(:method => :result), you run into namespace conflicts with
2006 Sep 18
2
Mocha + Selenium-on-rails loading problem ?
Hello All, I need to stub two class methods before a selenium call. The .rsel is : require ''mocha'' SalesConfigWork.stubs(:load_work_data) SalesConfigWork.stubs(:delete_work_data) setup :fixtures => :sales_config_works open "/" The Selenium test runner result is : undefined method `stubs'' for SalesConfigWork:Class Extracted source (around line *#0*):
2006 Aug 14
14
A mock which extends rather than replaces a class?
While running tests, we would like to instrument some of the classes under test. We still want the classes to do exactly what they currently do, but we would like them to do more when running in the test environment. Clearly we can (and currently do) just extend the objects "on the fly" where necessary, but this is a bit messy - we''d like some centralised way to always
2012 Dec 07
0
[Bug 1585] Allow an `Include' option which reads another config file in place and does not error out when `Include' file not readable
https://bugzilla.mindrot.org/show_bug.cgi?id=1585 Tomas Pospisek <tpo_deb at sourcepole.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tpo_deb at sourcepole.ch --- Comment #2 from Tomas Pospisek <tpo_deb at sourcepole.ch> --- +1 I needed
2010 Apr 29
2
dopar parallel assignments
Hi guys, I was wondering why this piece of code doesn't work: foreach (i = c(1.25,1.50)) %dopar% { assign(paste("test_",i,sep=""),i) } but, this does: foreach (i = c(1.25,1.50)) %do% { assign(paste("test_",i,sep=""),i) } Obviously, the difference is %dopar% vs. %do%. If I use %do%, I get objects test_1.25 and test_1.50, but I don't get these
2006 Sep 12
4
ActiveRecord Validations - validates_uniqueness_of
Hello, I''m wanting to use Mocha and Stubba for my tests in place of the default Rails testing with fixtures. I have the following class: class Person < ActiveRecord::Base validates_uniqueness_of :email end and am wondering how I can test to ensure that the validates_uniqueness_of validation is running. Any ideas? -Jonathan
2006 Aug 17
1
expectations on stubs (stubba) or mock methods on existing classes?
Hello, First, thanks for releasing Mocha. As someone who''s been practicing TDD much longer than I''ve been using Rails, one of my biggest complaints has always been the fact that the "Unit" tests are more like intefration tests because of how tightly coupled the domain model is when using ActiveRecord. Stubba looks like it could really help aleviate this problem. The
2007 Apr 11
1
Fwd: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 11-Apr-2007 15:24 Subject: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases To: noreply at rubyforge.org Bugs item #5892, was opened at 2006-09-25 07:49 You can respond by visiting: