similar to: How to spec code with multiple (interacting) paths

Displaying 20 results from an estimated 4000 matches similar to: "How to spec code with multiple (interacting) paths"

2007 Oct 31
16
Am I missing something with Heckle?
Hi I can''t get heckle working. In fact, I''ve built an example so simple that it either shows a bug, or I am being really, REALLY stupid. Heckle does not appear to support RSpec directly, so I''m trying to use spec --heckle (RSpec trunk as of 10 mins ago, Heckle 1.4.1). I''ve constructed this pair of sample files: 18> ~/Desktop/heckle_test % cat
2006 Dec 15
3
Partial mock when a complex return value is required
Hi I''ve come up with a problem using RSpec on a model class in my rails app. I wanted to test that some data was being cached for some calculations, so rather than do state-based testing I tried to specify that the method that fetches the data should NOT be called when I call the calculate method. However in doing so I have to simulate the return value, which is about 27
2008 Mar 28
2
Wrong story step running
Hi I have three steps like this: Given ''a user called "$name" of type $user_type and status $user_state in organisation "$organisation_name"'' do |name, user_type, user_state, organisation_name| $runs ||= 1 puts "MOO #{$runs}" $runs += 1 # ... end Given ''a user called "$name" with username
2007 Jul 11
21
"they" synonym for "it"?
I''ve noticed that I phrase a lot of shared behaviours in plural, eg describe "All payment_details views" How about a "they" alias to "it" so you can write describe "All payment_details views", :shared => true do they "should have a card number field" do # ... end end WDYT? Ashley
2007 Feb 12
6
Specs for Ajax partials with unicode characters
Hi Not sure if this is more Rails or RSpec related... I''ve got an app with an RJS view that updates a div in a page with the contents of a partial. The partial contains a non-ascii character namely a pound sign. I set up a simple test app with this RJS view: page.replace_html("test_div", :partial => "test_action") and this _test_action.rhtml:
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
2006 Apr 17
6
DO NOT REPLY [Bug 3692] New: regression: symlinks are created as hardlinks with --link-dest
https://bugzilla.samba.org/show_bug.cgi?id=3692 Summary: regression: symlinks are created as hardlinks with -- link-dest Product: rsync Version: 2.6.7 Platform: x86 URL: http://rsync.samba.org OS/Version: FreeBSD Status: NEW Severity: major Priority: P3 Component: core
2007 Dec 29
0
should send_email always succeeds?
I wrote the following in my spec: emails = ActionMailer::Base.deliveries emails.length.should eql(2) response.should send_email { with_tag(''tr'', @contact_info[:full_name]) } knowing that 1) an email is being sent; and 2) the contact info is in a ''p'' tag and only in a ''p'' tag. The length expectation is met --
2007 Feb 26
0
Specifying Ajax hyperlinks
I was about to put this as a feature request but I wasn''t sure if anyone would consider it useful so I thought I''d ask here. I''m not sure what the feeling on specifying links is - it strikes me as something that needs doing because it''s generated code at the end of the day. I''ve got a few lines now along the lines of:
2007 Jul 12
3
Agh, this is annoying. Why is this happening?
My problem: Mock ''Task_1005'' received unexpected message :user_id= with (1) No matter what I do to try to stub that out it will still fail out and give me that message. Here is my spec describe TasksController, "handling POST /tasks" do before(:each) do @task = mock_model(Task, :to_param => "1", :save => true)
2007 Feb 28
12
Specifying that code is called in a block
Not sure if this is possible currently. I have a section of code like this: ActiveRecord::Base.transaction do cow.save! duck.save! dog.save! end (Names changed to protect the innocent.) I''d like to specify that the saves run in a transaction. I can do ActiveRecord::Base.should_receive(:transaction).and_yield But is there any way to specify that the code is
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
2012 Mar 20
0
[LLVMdev] Runtime linker issue wtih X11R6 on i386 with -O3 optimization
I was told that my writeup lacked an example and details so I reproduced the code that X uses and I was able to boil down the issue to a couple of lines of code. Sorry again for the length of this email. Code was compiled on OpenBSD with clang 3.0-release. ======================================================================== With -O0 which works as X expects:
2009 Nov 03
3
Weird operator behaviour
Hi, I have a dataset called 'fish'. fish$Species returns extract 1. When I use fish$Species != c("CRA","PHC"), i.e. I want all species except "CRA" and "PHC", I get extract 2 which is blatantly wrong. Can anyone see what I'm doing wrong? Regards, James EXTRACT 1 > fish$Species [1] ALB ALB ALB ALB ALB ALB ALB ALB ALB ALB ALB ALB ALB
1996 Mar 23
0
No subject
Announcing Moo-Tiff for FreeBSD 2.1. Sender: owner-freebsd-announce@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Moo-Tiff is a 100% compatible port of OSF/Motif 2.0 for FreeBSD 2.1, built from the official OSF sources and run through the OSF VTS (Validation Test Suite). If it works with OSF/Motif 2.0 on any platform, it can now work on FreeBSD 2.1 with Moo-Tiff ! Moo-Tiff is priced at
2006 Jan 23
1
learning how models, controllers, and views pass data
As a noob to Rails and web development in general, I think I still need a broader understanding of how Views, Controllers, and Models pass information and variables to each other. I''m creating a site that allows for email campaigns. I have a ''create_email_controller'': class Admin::CreateEmailController < Admin::BaseController layout ''admin'' def
2013 Jan 16
2
Codetools Query (repost)
Sorry for reposting, i keep forgetting this should be plain text. Will not make this mistake again Hello, The following code moo <- function(a=1){ x=1; x=x+y} funs <- new.env() enter <- function(type, v, e, w){ assign(v, TRUE, funs) } library(codetools) collectUsage(moo, enterGlobal = enter) adds + to the environment funs i.e. funs: "=" "{" "+"
2006 Feb 02
3
dynamic addition of table rows
Hi, I have a table laid out something like this: <table> <thead> <tr> <th>col 1</th> <th>col 2</th> </tr> </thead> <tbody id="tablebody"> <tr> <td>moo</td> <td>moo</td> </tr> <tr> <td>moo</td> <td>moo</td> </tr>
2004 Feb 22
2
Crashed filesystem - directory recovery
Hello folks, I had an ext3 filesystem mounted as the root of a Linux MOO server. Unfortunately, the filesystem was on one of the infamous DTLA-3070xx drives - and the drive decided to fail at the worst moment it possibly could, trashing the filesystem fairly well. The situation is as follows: I used dd_rescue to create an image of what is left of the filesystem, but I ended up with some 65MB
2008 Dec 04
3
The RSpec way of doing this? Need help on validating block
Hello, I''m back again with more questions about mocks and how to do good testing in general. Let''s say I''m writing this EmailSender class and I want to make it totally awesomely tested with RSpec. Here''s how far I''ve gotten so far: require ''net/smtp'' class EmailSender def send_email