similar to: should_receive(:foo).with(any_object)

Displaying 20 results from an estimated 110 matches similar to: "should_receive(:foo).with(any_object)"

2007 Jun 03
3
should_receive.again
Hi, It appears that if I have 2 should_receives in a row, the latest one overrides the previous one(s). If there isn''t one, could we add a way to accumulate them, such as @thing.should_receive(:method).and_return(@value) @thing.should_receive(:method).again.and_return(@value) @thing.should_receive(:method).again.and_return(@value) would be equivalent to
2005 Mar 16
19
IPSwitchBoard BETA
Hi all, I have just published my last few weeks of hard work: IPSwitchBoard BETA. Please let me know what you think and post comments on the Wiki. http://www.voip-info.org/wiki-IPSwitchBoard+BETA Thank you
2005 Mar 18
2
Parking a call in manager interface
Is it possible to park a call through the manager interface? If yes; how? Regards Thorben -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050318/ec2a5f90/attachment.htm
2004 Dec 01
4
Voicemail - Danish, German an French audio files download?
Hi all, Is it possible to download Danish, German and French audio files for Asterisk somewhere, or does everybody just record them? Thank you in advance Thorben -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20041202/02cec53d/attachment.htm
2007 Oct 17
0
should_receive
Is there any way to setup a should_receive so that it returns whatever it was passed in from the actual code? I just want to make sure that a specific function is called, I don''t want to mess around with the parameters it receives, or what it does inside, or what it returns. Is that possible? Using should_receive seems to default to returning nil.
2007 Oct 22
0
Pending should_receive shows as FIXED
I have a mock should_receive expectation wrapped in a "pending" block, and it appears as being fixed when the specs are run, when in reality it is not. Anyone else experience this behavior? I''m assuming this is because the mock waits until the "it" block completion to determine expectations rather than its enclosing "pending" block. Steve
2007 Feb 20
1
having should_receive expectation for things that happen in setup
Hi! The following example doesn''t work for me: http://pastie.caboo.se/41732 However, if the call to msg() happens in the specify block after the expecation and not in the setup, it will pass. Why is this? I thought the setup method was there to actually ''construct'' the context and the specifications are some kind of "postconditions" that only need to be
2008 Jun 12
1
how do I mock the Rails Logger with should_receive?
Hey Guys, I''m trying to mock the Rails Logger for the following code: ... rescue TimeoutError => error $logger.error("#{self.name} Timeout for #{path}: #{error}") and return rescue SocketError => error $logger.error("#{self.name} SocketError for #{path}: #{error}") and return rescue StandardError => error
2008 Jun 12
1
Does anyone know how to mock the Rails Logger then set expectations with should_receive?
Hey Guys, I''m trying to mock the Rails Logger for the following code: ... rescue TimeoutError => error $logger.error("#{self.name} Timeout for #{path}: #{error}") and return rescue SocketError => error $logger.error("#{self.name} SocketError for #{path}: #{error}") and return rescue StandardError => error
2013 May 11
1
STDOUT.should_receive(:puts).with Works *** (:print) fails
I use: STDOUT.should_receive(:puts).with...... many times in RSPEC However, I have a couple of "do you want(Y/N)?" where I use ''print'' and apparently ..(:print).with... does not work. I can change ''print'' to ''puts'' and it works perfectly. How do I test :print and ...getch("y") for input??? Any help would be
2008 Jan 13
2
should_receive twice and arguments
Hi all, I have a method calling Klass.create! two times with different arguments (this happens in a class reponsable for reading in a csv file) I want to test those like this: in one test: Klass.should_receive(:create!).with(:name => "foo").once in another: Klass.should_receive(:create!).with(:name => "foo2").once This doesn''t work because the
2008 Mar 14
2
Multiple should_receive(:render).with
I''m trying to specify that a particular view must render two different partials. My spec looks like: describe AClass do it do template.should_receive(:render).with(:partial => ''foo'', :locals => { ... }) ... end describe ''some conditional case'' do it do template.should_receive(:render).with(:partial =>
2006 Mar 31
1
Asterisk hosted solution
http://voip-info.org/wiki/view/Easy+PABX With Easy PABX you can create your own virtual PABX online in just minutes. Easy PABX is based on Asterisk and best of all - it's completely free. Regards thorben.dk
2006 Dec 18
2
should_receive and multiple return values
Hi I just got bit by a misunderstanding about and_return. I''ve got this controller method parse_parameters that loops over query string parameters and parses out vehicle registration dates. We have to turn these into one of three bands (Jan-Feb, Mar-Aug, Sep- Dec) so I wrote a method (registration_date_to_band_year_and_month) takes a date and returns two return values, the year
2007 Aug 17
4
should_receive, used in the wrong place?
What do you guys think of this: if someone calls should_receive outside of an "it" block, it warns you. before(:each) do @foo = Foo.new @foo.should_receive(:monkeys) end would warn you that you''re setting an expectation in the wrong place, and that "stub" is correct when setting up objects. Opinions? courtenay
2007 Nov 15
2
Trouble using should_receive
I have this code trying to ensure my reset method works. I want to make sure all the participants have their destroy method called. # in my spec for Room r = Room.new(:name => ''bob'') r.save p = Participant.new(:login => ''a'', :password => ''b'', :password_confirmation => ''b'') p.room = r
2007 Dec 13
3
rsync 3.00pre6 segfault in add_dirs_to_tree
Hi All I run rsync in an automated environment and it sometime will crash and leave a core dump file. from core dump, gdb shows that gdb) bt #0 add_dirs_to_tree (parent_ndx=-1, from_flist=0x56c590, dir_cnt=1) at flist.c:1422 #1 0x0000000000409eab in send_file_list (f=16, argc=-1, argv=0x56c238) at flist.c:2068 #2 0x0000000000419052 in client_run (f_in=16, f_out=16, pid=-1, argc=1,
2008 Aug 08
2
template.expect_render fails when partial is rendered from a helper
My spec; describe ''subnav rendering while logged in'' do before do template.stub!(:logged_in?).and_return(true) template.stub! (:current_profile).at_least(:once).and_return(mock_profile) end def do_render render "/homepages/show.html.erb" end it "should render the logged in partial for homepages" do
2007 Jun 21
4
should_receive stubs methods?
Hey, I''m using rspec and rails and have a spec that tests if a before_filter is executed, I also have a spec that tests if a method called by the filter is executed. It appears however that when I should_receive something, it is no longer actually called when I fire the http request. I''m not sure how, or where exactly I should manually fire the filter, either before or after the
2004 Dec 07
4
Transfer on Snom 190
I cannot get the transfer button to work on a Snom 190, I cannot get the # to work either. Any ideas? Regards Thorben -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20041207/5ac06747/attachment.htm