search for: moazeni

Displaying 11 results from an estimated 11 matches for "moazeni".

Did you mean: mazen
2009 Jul 09
3
before(:all) and nested contexts
On Thu, Jul 9, 2009 at 5:40 AM, Daniel Tenner<daniel.rspec at tenner.org> wrote: > Hi all, > Like everyone (?), I use nested contexts to keep my specs well organised and > tidy. > However, I have a problem. I have various sets of specs that needs to > perform very time-expensive operations to set up the fixtures that will be > examined in the tests. Two specific examples:
2007 Jul 26
5
Test errors without verification
I''m not sure if this is by design, but I''ve stumbled across this a few times trying to debug my own tests. If an assertion fails the test, and a mock expectation was to blame, the test''s failure / error messages don''t give enough info. I''ve had to resort to def teardown mocha_verify end which just gets tedious. I''ve created a patch
2007 Sep 05
4
Mocking to spec a sort_by method
Hello, I have a question regarding the use of Mocha with rSpec to spec one of my methods. My spec contains the following vehical1 = mock() vehical2 = mock() vehical1.stubs(:mph).returns(150) vehical2.stubs(:mph).returns(250) comparer.add_vehical([@vehical1, @vehical2]) comparer.sort_by(:mph) The comparer is an object that has a basic "stack like" functionality, add_vehical is the
2009 May 23
9
undefined method `assert_select'
I''m having trouble getting the specs to run for a plugin where I want to fix a bug. (I''ve actually already found and fixed the bug, but I don''t want to submit a fix without a test!) When I started the specs weren''t running, but it may be that I''m using Rails 2.3.3 and the plugin has been tested on 2.1 and earlier. I went through writing a spec for a
2007 Oct 20
14
Problems with form_for and partials
i''m having problem with a form_for situation where i''m trying to DRY out the repeated parts of my forms and put them in common/form and render the form elements via another partial in controller_name/_form. Here''s the first form # app/views/common/form <% form_for ... do |f| -%> <%= render :partial => "params[:controller]/form", :object => f
2008 May 20
7
Expect with "real world" returns?
Is there a way to do something like this? class Foo def self.hello(name) "Hello #{name}!" end end Foo.expects(:bar).with("Carl").once assert_equal "Hello Carl!", Foo.hello Basically, my problem is that once you set an expectation, the original code is never executed and is not tested. However, it''s still very useful to set expectations to
2007 Nov 11
1
Mongrel and Camping
Why is the camping handler using Mutex#synchronize to serve requests? I was under the impression that camping was considered more thread safe than Rails? -Zach
2010 May 17
2
"end of file" error for "net/https"
Hi, I have written following code:- It is working fine for http protocol. But whenever I am doing for https I getting an error "end of file reached". Can anyone tell me what is wrong with the code? def email_to_friend require ''net/http'' require "net/https" require ''uri'' #res =
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them do not. Does anyone know if there is a way to disable the HttpMocks after they have already been loaded? The method ActiveResource::HttpMock.reset! only removes all the objects, but ActiveResource still thinks it should look for mock requests rather than actually making requests. I hope this makes sense! Thanks, Tom --
2006 Jan 29
0
OffTopic - But Question about Current status of Ruby Talk List
Pardon, I know this isn''t the right forum, but for some reason it seems Ruby-Talk has been silent for days...which I''m definitely not used to. Is the mailing list server down? or having technical issues? Again, I apologize for posting this question on this forum, but not sure where else to ask. -Zach
2007 Jun 21
3
With Parameter Block
I''m curious why the Parameter block check for the with is going to be removed. I like the concept of clean, readable tests, however I also like to test as efficiently as possible. For some tests, I''ll take the approach of putting test assertions inside the parameter block, and always returning true. This is a contrived example: def test_something mock =