similar to: The RSpec way of doing this? Need help on validating block

Displaying 20 results from an estimated 500 matches similar to: "The RSpec way of doing this? Need help on validating block"

2007 Nov 04
3
Specing raising error, handling, and then not raising error
Hey guys and gals, I have a snippet of code: Net::SMTP(@host, @port, @from_domain) do |smtp| @emails.each do |email| begin smtp.send_message email.encoded, email.from, email.destinations @emails_sent += 1 rescue Exception => e # blah end end end What I want to do is: Say there are 4 emails. First email is sent OK On the second email smtp raises a IOError
2006 Mar 29
4
Collecting data from forms
Hi, I?m having some problems collecting the content of some forms. This is whats in list.rhtml: <%= form_tag :action => ''send_message'' %> From: <%= text_field ''message'', ''from''%> <br>Message: <%= text_area ''message'', ''text'', :rows => 6 %> <tr> <td></td>
2007 Aug 12
5
stubbing a method that yeilds sequential results
I''ve just found myself stuck trying to rspec something so am hoping someone more knowledgable can help. I have a Connector class which has a class method ''results'' that yields results it get from a network service based on a set of attributes that I pass to it. I am wanting to yield these results from my Intermediate class up to the next
2005 Dec 24
10
can''t find view from Mailer?
Hi everyone, Like so many other here, I too am new to Rails (and Ruby), and so far it''s been a great experience. I haven''t been able to get around one problem though. When trying to use the mailer, I recieve an error like this: ActionView::ActionViewError in Tell_friend#send_email No rhtml, rxml, or delegate template found for send_to_friend The scenario is this: A form on
2015 Apr 01
1
Remote protocol abstracted
I have been working in the abstraction of the remote protocol to separate it from the server and the connection. The purpose of this is I need to use the Xapian remote protocol in a server we are working on (named Xapiand: https://github.com/Kronuz/Xapiand) which is similar to some extent to the `xapian-tcpsrv` in that it also serves databases remotely through TCP, using the binary protocol. What
2006 Oct 27
8
Error after moving to production server
so i have an after_create method on my track model that kicks off a background process that converts an mp3 to a swf. this is working fine locally on my machine, but upon moving it to my production server, i am getting the following error. I''ve only been using backgroundRB for like 48 hours, so i''m not really sure what this means or where to go. any ideas?
2008 Oct 17
4
Error when posting facebook.feed.publishActionOfUser
posting ''facebook.feed.publishActionOfUser'' with {:title=>"<fb:fbml> <fb:name ifcantsee=\"A Hidden User\" linked=\"true\" uid=\"579947937\" /> wrote a <a href=\"http://apps.facebook.com/dailycaption/captions/1273\">caption</a></fb:fbml>",
2007 Aug 08
5
and_yield + instance_eval(&block)
I have the following code, which yields instance eval''s the block given: class Foo def bar(&blk) instance_eval &blk end def baz yield end end The effect of this is that self is reassigned: Foo.new.bar do # here, self is the instance of Foo # created by new end But normally self is the object in which Foo.new.bar {...} occurs. Foo.new.baz do
2016 Jun 20
2
Compilation problem with a few configure option
Hi Compilation of 1.3.7 dies with the following configuration: ==================================== ./configure --enable-shared --enable-static --disable-sse --disable-backend-inmemory --disable-backend-remote ==================================== During the compilation I get the following error: ==================================== /bin/bash ./libtool --tag=CXX --mode=link g++ -fshow-column
2009 Apr 09
1
Mailing error in Rails 2.3.2
Hi, My mails were working with the earlier version of rails ie. Rails 2.0.2. But recently when i upgraded my environment to 2.3.2 the mails stopped working and gave "Error: End of file reached". But if i send mails independent of my rails app the mailing code works fine. My Environment: Windows Xp Ruby 1.8.7 actionmailer (2.3.2) actionpack (2.3.2) activerecord (2.3.2) activeresource
2005 Dec 17
13
Rookie with ActionMailer
To start out I''ll say that this is the first thing that I''ve ever built that''s been intended to programmatically send email. I''m looking at examples in AWR and also on the wiki. I feel that I sort of have things set up right but I''m getting an error I can''t grok: Net::SMTPFatalError in Home#email_list 550 5.7.1 Unable to relay for
2006 Feb 21
26
Net::SMS::BulkSMS 0.1
This is the first release of a new Ruby library for the www.bulksms.co.ukAPI which should allow simple integration of SMS functionality into your Ruby or Rails apps. Sending a message is as simple as: @service = Service.new(''username'', ''password'') @service.send_message(''This is my message!'', ''4479123456789'') # whats my
2005 Sep 10
1
PRI echo
Hi, My configuration is pri----*(te405p)---iaxclient. My * version is 1.0.7 running on tyan dual opteron board. I have several problems. 1) inbound echo For outbound call(iaxclient-->pri), there is almost no echo. But for inbound(pri-->iaxclient), I can hear distinct echo. Can Sangoma a104 or digium te406p help this problem? 2)Today i received te406p. I know T1/E1 jumper. But how can i
2007 Aug 06
1
Stubbing Enumerable#each
I have a mock of an instance of a class which descends from Array: class ArrayDescendent < Array; end #... in the specs... @descendent = mock ArrayDescendent How would I stub out ArrayDescendent#each, which is inherited from Array, to return multiple values successively? I could use and_yield, but that is raising an arity error (the anonymous function/ block should expect only *one
2007 Apr 20
7
Stubbing Model.new w/ block?
Ok, I followed the advice of the list and moved more code into my model from my controller. When developing tests for this new code, I ran into a problem... My model code creates a receipt object and sets some values on it: @receipt = Receipt.new do |r| r.x = 1 r.y = 2 # etc end I wanted to be able to stub out Receipt.new so that I could set expectations on the methods called on the
2008 Jun 05
1
Using and_yield to pass multiple or no iterations
Hi, imagine there''s a class called Egg which has the following method (which calls another method): <CODE> def do_thing has_iterated = false self.each_row do |row| has_iterated = true unless has_iterated end has_iterated end </CODE> Stupid code, I know. I have two questions with it. The first is, would it be possible to set it up to test the case when each_row
2012 Sep 15
2
[RSpec Testing] Methods take two arguments
Hello, Here is my *pdf_helper.rb* => http://pastebin.com/QU1kTKXk. I want to test, if self.create method can take more than two arguments. But, when I try to run my test. It showed *PdfHelper Should have two arguments Failure/Error: create_pdf.should_receive(object,template).with(user,file) NameError: undefined local variable or method `create_pdf'' for
2011 Nov 18
0
Jquery dialog
Hi, i had a index page with url as www.exa,com/users/jude.In that page i want to submit a from which appears from popup dialog.The action of the popup is going to send_message,Whenever i submits, via ajax the data gets stored but not the page gets reflected. My controller def send_message @message = current_user.messages.build(params[:message]) @message.receiver_id = @user.id
2008 Mar 28
8
Cannot run winecfg (output pasted)
Code: ~ # winecfg ALSA lib conf.c:3952:(snd_config_expand) Unknown parameters 0 ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM default:0 ALSA lib conf.c:3952:(snd_config_expand) Unknown parameters 0 ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM default:0 wine: Unhandled page fault on read access to 0x00000048 at address 0x7e2f476c (thread 0026), starting debugger... Unhandled
2006 Jul 18
6
backgroundrb - Connection closed
Hello, maybe someone can help with backgroundrb. I''ve written an application, which makes use of backgroundrb. Everything works fine on my development machine, but it crashes on my production server. Something seems to be wrong with backgroundrb, but I don''t know the cause. All I get is the error message attached below, which is extracted from the production.log. I