search for: specing

Displaying 20 results from an estimated 71 matches for "specing".

Did you mean: spacing
2007 Apr 12
3
specing class methods
...mple from autotest: class Autotest def self.run new.run end def new ... end def run ... end ... end How would I spec out Autotest.run? Two complications come to my mind: 1. How do I spec out class methods? (please point me to docs, if any. I can only find class level specing on "partial mocks" (of rails class objects) 2. How can I tell that new.run has been called, without saying should_receive(:new) and should_receive(:run) in separate specs? Another complication: How would I spec out the (instance level) run method, which has an infinite loop?...
2007 Sep 04
2
specing helpers fails on restful routes
Hi, I am trying to spec helper methods in a Rails project, but it seems the specs fail with the error: You might have expected an instance of Array. The error occurred while evaluating nil.<< if the restful routes helper are used either in spec files, or the helper file. What can I be doing wrong? Or how can I fix this. Thanks! -- Surendra Singhi http://ssinghi.kreeti.com,
2007 Feb 11
1
Specing Rails Views
Hello - I''m currently trying to write some specs for my rails views. My views depend upon the restful authentication plugin method logged_in? Like so, <% if logged_in? %> <ul id="product-admin-nav"> <dd><%= link_to "create a new product", new_product_url %></dd> </ul> <% end %> However, when I have the following
2007 Oct 13
1
specing system
Hi! Having some wine on Saturday and just playing around writing some ruby script: * have you spec any ''system'' method? As long I know it just returns false or true and everything else is just out of reach; prove me I''m wrong :-) it ''should have response with 64.233.167.99'' system ''ping google.com'' Priit
2007 Dec 22
1
Rails: Specing libraries
I was reading the documentation on using rails with rspec and I didn''t see anything about how to spec libraries in the rails /lib directory so that they''re integrated into the whole spec::rails system. Where should I put specs for my libraries, and what''s the best way to require the files that I''m testing in my spec? I''ve never used rspec before, and
2008 Mar 05
3
having trouble specing an ajax request
Do I need to spec an AR. If yes, what is the best way to spec this. here is the code - def index @deals = Deal.paginate(:all, :conditions => prepare_search_conditions, :order => ''created_at DESC'', :page => params[:page] ) if request.xhr? render :update do |page| page.replace_html "table", :partial =>
2007 Aug 03
2
Plugins ''speced'' with rSpec?
Hello, I''m trying to figure out how to setup a spec structure for plugins. I''m getting pretty lost in figuring out how to isolate a plugin enviornment emulating rails, but not actually being reflected upon the current rails project. What I mean is this, let''s say I have a comment plugin. This has two things in lib, the comment model (comment.rb) and then the module
2009 Feb 05
1
[rspec] [rails] Specing a form builder
I''m trying to set up and run a new form builder under rails, which lives under the helpers directory, but isn''t really a helper. (Not a module, so doesn''t mix in well) Short of dropping down into a view spec, how do I set up to actually spec the form builder? describe RandomFormBuilder do attr_reader :builder before do @object = mock_model(Foo) @builder =
2007 Feb 22
9
specking, speccing, or spec''ing
I vote for spec''ing. Anybody else?
2007 Oct 01
15
how to spec views
I''m trying to spec a view but haven''t done much view specing. This view render different partials depending on authentication of the user: annon, admin, player So I I''ll write if conditionals in the view with the partials it "should render signup propaganda for annon users trying to view games" do render "/games/index.rhtml&q...
2007 Oct 26
5
specing rescue, ensure and else blocks of an Exception
Greetings, I''m using rspec with rcov for my applications and there is one issue which I cannot solve nor can find any proper information regarding it: specing what is in a rescue block in case of an exception. I''m using Ruby on Rails and I usually make use of exceptions in my controllers, like the following example: def action @foo = Foo.find(1) @foo.update_attributes!(params[:foo]) redirect_to :back rescue ActiveRecord::RecordInval...
2007 Jul 28
2
specing a call to render :layout => "some_layout"
I''m trying to specify that an action should be rendered with a given layout one particular spec. What I''ve got at the moment is this. it "should render with the grabber layout" do controller.should_receive( :render ).with( :layout => "my_layout" ) do_get end This doesnt work even though this call to render is being executed. render :layout
2007 Oct 12
6
locals in partials
hiya, in specing a partial, how can i assign a local var that is normally passed via :locals ? i tried adding :locals => to the render call but that doesnt seem to take linoj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachmen...
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
2007 Oct 07
2
Specing exit codes
I am writing a small ruby script that will be accepting input from postfix''s pipe command (ie, not running via the shell, directly executing). One of the things I need to do it spec the exit codes to make sure I am returing the correct exit codes for each condition as Postfix will then return SMTP errors as appropriate. I have two files that concern this bit of the program, init.rb and
2007 Jun 21
3
(no subject)
Hi, Not sure if this is the right place for general questions on BDD style, but here goes... I have a class which behaves almost like a big function - you always instantiate it with a bunch of args, and call one of a couple of methods to get the results back. BDD style seems to like a separate describe block for each instantiation of the class under test. In this case that would mean a
2007 Aug 12
3
Scope and specing models
Hello all, I''m currently having an issue with some specs, specifically scope issues (probably more of a scope issue than a spec issue at this point)... Here''s the error: ActiveRecord::AssociationTypeMismatch in ''A new User should know what role it has'' Role expected, got NilClass D:/ruby/projects/restful_authentication_test/config/../app/models/role.rb:5:in
2007 Feb 05
1
long jumping out of code in specs
I wrote this abomination just now, and wonder if anyone else has had experience with the pattern behind it. In short, I''m specing an after_create hook on an ActiveRecord model, that calls a bunch of private methods. Instead of stubbing all those private methods (which is verboten anyway, as well as impossible because creating the object which owns those methods is what I''m specing, so I don''t have the object...
2007 Aug 15
3
ActsAsList specs
Hi, How are people specifying models which act_as_list? I''m thinking that it would be possible to check that acts_as_list instance methods have been added to a class using something like this: describe Page, "acts_as_list" do it "should act as a list" do Page.ancestors.should be_include(ActiveRecord::Acts::List::InstanceMethods) end it "should use
2011 Mar 17
4
respawning apache on centos
Hi I have a centos instance on a host where uname -a shows: Linux cl28810.com 2.6.18-194.26.1.el5.028stab079.2PAE #1 SMP Fri Dec 17 19:34:22 MSK 2010 i686 i686 i386 GNU/Linux Periodically my ssh access and http access slow dramatically and I get out of memory when trying to do rudimentary stuff like ls. I've been advised by tech support to try service httpd restart. This works. But the