similar to: Test post to list

Displaying 20 results from an estimated 400000 matches similar to: "Test post to list"

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
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
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
2007 Jan 23
2
SslRequirements plugin and mocha
Hi. I''m loving mocha but have ran into a problem with using the mocha plugin with a project that has the SslRequirement plugin. It seems there is some conflict between the two? Any ideas? $ ruby test/functional/calendar_controller_test.rb /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:478:in `const_missing'': uninitialized constant
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:
2007 Feb 23
0
Fwd: Mocha test retry to connect up to 10 times
---------- Forwarded message ---------- From: Raymond O''connor <nappin713 at yahoo.com> Date: 23-Feb-2007 08:20 Subject: Re: Mocha test retry to connect up to 10 times To: ruby-talk ML <ruby-talk at ruby-lang.org> Hemant Kumar wrote: > On Fri, 2007-02-23 at 14:57 +0900, Raymond O''connor wrote: >> >> Any help would be greatly appreciated, thanks!
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 Sep 11
4
Using rspec and mocha
I prefer to use rspec than test::unit for developing my apps. However I''ve found its mocking library to be pretty inflexible compared to Mocha. This isn''t really a surprise since rspec isn''t intended as a mocking framework, whereas Mocha is. So I''d like to play to both of their strengths and use rspec as my testing/specification framework and Mocha do to
2007 Mar 05
4
When to stub/when to mock (was Rails functional testing and Mocha)
Hi James, > From: James Mead <jamesmead44 at gmail.com> > Date: Mar 5, 2007 5:15 AM > Subject: Re: [mocha-developer] Rails functional testing and Mocha > To: mocha-developer at rubyforge.org > "I''d probably stub the call to find not expect it, because its a query not a command" I have a different perspective on when to use stubs and when to use mocks and
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
2006 Sep 03
2
Fwd: Dealing with exec?
---------- Forwarded message ---------- From: Kevin Clark <kevin.clark at gmail.com> Date: 01-Sep-2006 20:31 Subject: Dealing with exec? To: James Mead <jamesmead44 at gmail.com> Hey James, Sorry to bug you. I was curious how you''d handle a call to exec in a method you were testing. Kernel.stubs(:exec)... doesn''t seem to work but I''m not sure where else an
2006 Dec 15
0
Fwd: Re: [HOWTO] Edgemocha
---------- Forwarded message ---------- From: James Mead <jamesmead44 at gmail.com> Date: 15-Dec-2006 11:54 Subject: Re: [HOWTO] Edgemocha To: ruby-talk at ruby-lang.org On 15/12/06, jpywtora at calpoly.edu <jpywtora at calpoly.edu> wrote: > http://ruby-talk.blogspot.com/2006/12/get-edge-that-is-edgemocha.html > > All the mocha talk pushed me to the edge ;-) > Hope it is
2006 Sep 23
1
Fwd: [PATCH] Remove warning in expectation.rb
Begin forwarded message: > From: Xavier Shay <xshay at rhnh.net> > Date: 23 September 2006 05:53:57 BDT > To: james.mead at mail.com > Subject: [PATCH] Remove warning in expectation.rb > > Hi James, > Please find below a one line addition to lib/mocha/expectation.rb > to remove the following warning: > > mocha-0.3.2/lib/mocha/expectation.rb:32: warning:
2006 Dec 02
0
Fwd: Re: Mocha and ActiveRecord
---------- Forwarded message ---------- From: J. B. Rainsberger <jbrains762 at gmail.com> Date: 02-Dec-2006 02:48 Subject: Re: Mocha and ActiveRecord To: ruby-talk ML <ruby-talk at ruby-lang.org> James Mead wrote: > On 28/11/06, J. B. Rainsberger <jbrains762 at gmail.com> wrote: >> >> Suppose I have an Order, which has_many OrderItems. Suppose I want to >>
2007 Dec 23
0
Fwd: [ mocha-Bugs-16523 ] Ruby 1.9 gives warning
FYI - I''ve just released Mocha 0.5.6 to make Ruby 1.9 compatibility fixes available for those using released packages rather than subversion trunk. I''m not feeling well and so haven''t been able to test it other than by running all the tests using Ruby 1.9. Please let me know if you have any problems using it. Remember that it sometimes takes a while for a new gem
2007 Apr 11
0
Fwd: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 11-Apr-2007 15:07 Subject: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s To: noreply at rubyforge.org Bugs item #6416, was opened at 2006-10-31 15:34 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=6416&group_id=1917
2006 Dec 15
0
Fwd: Re: Re: [HOWTO] Edgemocha
---------- Forwarded message ---------- From: James Mead <jamesmead44 at gmail.com> Date: 15-Dec-2006 17:37 Subject: Re: Re: [HOWTO] Edgemocha To: John Pywtorak <jpywtora at calpoly.edu> On 15/12/06, John Pywtorak <jpywtora at calpoly.edu> wrote: > Compare > ~$ sudo gem install mocha > Attempting local installation of ''mocha'' > Successfully
2008 Jan 02
2
Proxies
I really like the idea of Mock Proxies as explained in Brian Takita''s post here: http://pivots.pivotallabs.com/users/brian/blog/articles/352-introducing-rr I posted to this list eariler with an incomplete implementation of .stops_mocking in the thread "Mocking Time, delegating to original object." The Mock Proxy pattern would make this simpler.
2007 Oct 15
0
Fwd: Content filtered message notification
I''m not sure why mailman bounced your message (perhaps because you are not subscribed to the mailing list), but I''m glad you have solved your problem. Cheers, James. ---------- Forwarded message ---------- From: mailman-bounces at rubyforge.org <mailman-bounces at rubyforge.org> Date: 14 Oct 2007 17:21 Subject: Content filtered message notification To:
2007 Mar 09
0
Fwd: Mocha raise exception first call, return value second call
---------- Forwarded message ---------- From: James Mead <jamesmead44 at gmail.com> Date: 07-Mar-2007 10:04 Subject: Re: Mocha raise exception first call, return value second call To: ruby-talk at ruby-lang.org On 07/03/07, Raymond O''Connor <nappin713 at yahoo.com> wrote: > > Is there a way to have mocha raise an exception the first time an stub > is called, and then