Re: [rspec-users] URL helpers in model specs

2011-10-11 Thread Nick
Hey Matt. Thanks for replying. I deleted that gist by accident earlier today. Despite that, the problem's solved by including Rails.application.routes.url_helpers in my model. My Rails console sessions include Rails.application.routes.url_helpers automatically, which is why it worked in IRB but

[rspec-users] URL helpers in model specs

2011-10-11 Thread Nick
ly, that's not ideal, because it's only necessary for the specs to work. Is there any other solution? https://gist.github.com/1275799 Thanks, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] rspec and should eql

2011-09-05 Thread Nick
Try "eq" or "equal". ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] mongo_mapper validations, rpsec

2011-09-04 Thread Nick
What does the backtrace say?___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] mongo_mapper validations, rpsec

2011-09-04 Thread Nick
Hey Chris. Could you be more specific than "it blows up"? If there's a stack trace, that'd be helpful.___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] rspec assert inclusion in..

2011-09-03 Thread Nick
Hey Slavix. How about this: it 'has a valid "attribute_x" value' do valid_values = %w(some values here) valid_values.should include subject.attribute_x end ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/r

[rspec-users] What causes "undefined method `each_pair'"?

2011-09-01 Thread Nick
me more complete code snippets: https://gist.github.com/1178636 Any help would be greatly appreciated. Thanks! Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Selectively ignoring exceptions in examples

2011-08-29 Thread Nick
Hey there, Ash. Why not put your call to #run_command inside a begin-rescue statement?___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Stubbing #render_to_string overrides #render

2011-08-16 Thread Nick
On Tuesday, August 16, 2011 8:02:08 AM UTC-4, dchel...@gmail.com wrote: > > IIRC, render(:json) eventually goes through render_to_string, which would > explain the behavior you're seeing. I could be wrong, but have a look at the > Rails code as a starting point. Thanks, David. I'll trace throu

[rspec-users] Stubbing #render_to_string overrides #render

2011-08-15 Thread Nick
not, how can I stub #render_to_string without affecting #render ? Thanks, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] render_views and render_to_string

2011-03-13 Thread Nick
Bump. Any ideas? On Sunday, March 6, 2011 5:48:29 PM UTC-5, Nick wrote: > > Hey guys. One of my controller actions uses #render_to_string to send back > a JSON response. > > When I try to spec this, Ruby raises a NoMethodError, saying that > #render_to_string doesn't

[rspec-users] render_views and render_to_string

2011-03-13 Thread Nick
40962 Any idea what I'm doing wrong? Thanks, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Model validation failing in rspec for unknown reason

2011-02-08 Thread Nick
On Tuesday, February 8, 2011 12:25:30 PM UTC-5, The Ultimation wrote: > > Hi, i'm getting the following error when running a spec on my controller > for my Equipment model. > > it "edit action should render edit template" do > get :edit, :id => Factory(:equipment) > Shouldn't you pass an

Re: [rspec-users] Feedback Requested (pretty please)

2011-01-28 Thread Nick
On Friday, January 28, 2011 12:09:38 PM UTC-5, ants wrote: > > Yes, I've come a long way since posting that. I'm embarrassed by that post > but after reading the book and getting started, I just wanted some > feedback. Hah, don't be embarassed. Everyone starts out pretty rough with BDD. What's

Re: [rspec-users] specing nested models

2011-01-27 Thread Nick
On Wednesday, January 26, 2011 10:34:14 AM UTC-5, Cezar Halmagean wrote: > > That worked great, thank you. You're welcome, mate! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] specing nested models

2011-01-27 Thread Nick
How about: it 'builds a comment in the post' do post = Post.new comments_assoc = mock comment = mock_model Comment post.stub(:comments).and_return comments_assoc comments_assoc.should_receive(:build).with(no_args).and_return comment # invoke something to trigger the action end _

Re: [rspec-users] [newbie] CSS navigation in controller response?

2011-01-25 Thread Nick
Would replacing :content => "moribund" with :content => /moribund/ work? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [newbie] CSS navigation in controller response?

2011-01-25 Thread Nick
Whoops, let me fix that: Would replacing :content => "moribund" with :content => /moribund/i work? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Feedback Requested (pretty please)

2011-01-24 Thread Nick
Also, try to keep have just one expectation (IE: call to #should) in each test. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Best Practice for Controllers

2011-01-17 Thread Nick
That behaviour exists in ApplicationController. Since ProductGroupsController inherits that behaviour from ApplicationController, the specs for ProductGroupsController should cover that behaviour. To keep your code DRY, create a shared example group that can be used in multiple controller specs

Re: [rspec-users] Problem with output at running specs

2011-01-17 Thread Nick
On Saturday, January 15, 2011 7:56:48 PM UTC-5, rdavila wrote: > > Hi folks, I'm using rspec-rails 1.3.3 with a rails 2.3.2 app, I'm > setting up the test environment, an every time that I run the specs I > get this weird output: http://codepad.org/3bGWsENn > > Do you know how I can get rid of this

Re: [rspec-users] [rspec-rails] how to test module behavior once and then confirm that controllers implement it?

2011-01-14 Thread Nick
uot;. > Cracking this could save me from duplicating the testing of the full > behavior of the filters in several instances, in several > ActionController classes. > I hope that helps! Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How to test scripts in the lib directory of Rails?

2011-01-07 Thread Nick
Hey Volkan. Make sure to "require" the file that your Query class is in. Usually this is done at the top of query_spec.rb , or in spec_helper.rb . Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailma

Re: [rspec-users] Looking for a gem which uses rspec for testing and tests need to deal with database

2011-01-04 Thread Nick
How about vestal_versions? https://github.com/laserlemon/vestal_versions I found it by going to Ruby Toolbox, and looking at the ActiveRecord-related gems. http://ruby-toolbox.com/categories.html Good luck! Nick ___ rspec-users mailing list rspec

Re: [rspec-users] Specs for controllers and rescue_from

2010-11-24 Thread Nick
On Nov 21, 5:02 pm, David Chelimsky wrote: > http://relishapp.com/rspec/rspec-rails/v/2-1/dir/controller-specs/ano... Fantastic. Thanks, David! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Specs for controllers and rescue_from

2010-11-20 Thread Nick Hoffman
ination, but fails to provide specs for the other controllers that inherit the rescuing behaviour. How would you spec this? I'm all ears! Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Speccing the creation of a singleton resource

2010-04-20 Thread Nick Hoffman
ther or not it's a singleton resource. Any suggestions? Thanks, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] lots of nil problems!

2010-03-19 Thread Nick Hoffman
Hey Patrick. > I have this in my controller action: > > from_address = Setting.find_by_name("shipping_from_address").address > > and my spec fails: > > NoMethodError in 'Admin::ShippingLabelsController should render a pdf > file' > undefined method `address' for nil:NilClass > > yet in the con

Re: [rspec-users] lots of nil problems!

2010-03-19 Thread Nick Hoffman
nd I will repost. > > -patrick No worries, mate. There's an email header that identifies which thread a given post belongs to. If you reply to a post, your reply will inherit that header, and thus be associated with the thread. Cheers, Nick -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] lots of nil problems!

2010-03-19 Thread Nick Hoffman
Patrick Collins wrote: > Hi, > > I have this in my controller action: > > from_address = Setting.find_by_name("shipping_from_address").address > > and my spec fails: > > NoMethodError in 'Admin::ShippingLabelsController should render a pdf > file' > undefined method `address' for nil:NilClass

Re: [rspec-users] stub vs stub!

2010-03-19 Thread Nick Hoffman
Pat Maddox wrote: > I've never heard of CurbFu, but according to > http://github.com/gdi/curb-fu/blob/master/lib/curb-fu.rb#L43 it defines > a stub method already. So you're hitting that one, which expects two > arguments. stub! goes to RSpec's mocking framework. > > Pat Good catch! Thanks,

[rspec-users] stub vs stub!

2010-03-19 Thread Nick Hoffman
the disappear. Any idea what's going on? http://codepad.org/P2uIlJVj Thanks, Nick -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Is share_examples_for deprecated?

2010-03-15 Thread Nick Hoffman
emdub wrote: > I think what is easiest/cleanest in the code should prevail :) I > personally like "shared_examples_for", but can easily adapt to > whatever decision is made. > > On a semi-related note. Where do I require my shared specs so > it_should_behave_like can find my shared example groups?

Re: [rspec-users] Is share_examples_for deprecated?

2010-03-07 Thread Nick Hoffman
is: sharing its examples with other example groups. Passing ":shared => true" to a "describe" is less obvious to me, simply because it doesn't stand out. This is especially true when ":shared => true" is at the end of a long string. Eg: http://pastie.or

Re: [rspec-users] Is share_examples_for deprecated?

2010-03-06 Thread Nick Hoffman
Pat Maddox wrote: > describe "something something", :shared => true do > ... > end > > describe "chunky bacon" do > it_should_behave_like "something something" > end BTW, is rspec.info supposed to be up-to-date? It still recommends using "shared_examples_for". http://rspec.info/documentatio

Re: [rspec-users] Is share_examples_for deprecated?

2010-03-06 Thread Nick Hoffman
Pat Maddox wrote: > describe "something something", :shared => true do > ... > end > > describe "chunky bacon" do > it_should_behave_like "something something" > end Thanks, mate. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing li

[rspec-users] Is share_examples_for deprecated?

2010-03-06 Thread Nick Hoffman
API Dock says that "share_examples_for" is deprecated. If that's correct, what should we be using instead? http://apidock.com/rspec/Spec/Extensions/Main/share_examples_for Thanks, Nick -- Posted via http://www.ruby-forum.com/. ___ rspe

[rspec-users] GET a path in a controller spec

2010-01-31 Thread Nick Hoffman
et '/foods/search/almonds' 123response.should redirect_to "/almonds" 124 end How can I spec this? Thanks for your help, Nick -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Troubles with route_for

2010-01-23 Thread Nick Hoffman
'search' Unfortunately, the spec for the second route fails because #route_to finds and uses the first route when generating the path for :controller => 'foods', :action => 'search', :name => 'almonds' routes.rb: http://codepad.org/CjKRynr5

Re: [rspec-users] Troubles with route_for

2010-01-13 Thread Nick Hoffman
David Chelimsky wrote: > On Wed, Jan 13, 2010 at 10:20 AM, Nick Hoffman > wrote: > >> > Yes - route_to checks both sides of the translation. >> >> Great, thanks for that, David! > > > Thank Randy Harmon for this one. It was he who recognized and solve

Re: [rspec-users] Troubles with route_for

2010-01-13 Thread Nick Hoffman
David Chelimsky wrote: > On Tue, Jan 12, 2010 at 11:35 AM, Nick Hoffman > wrote: > >> By the way, does this spec: >>{:get => '/path'}.should route_to(...) >> make this spec redundant?: >>params_from(:get, '/path').should

Re: [rspec-users] Troubles with route_for

2010-01-12 Thread Nick Hoffman
By the way, does this spec: {:get => '/path'}.should route_to(...) make this spec redundant?: params_from(:get, '/path').should == {...} They read the same, but it feels like they each check one end of the route's translation. -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] Troubles with route_for

2010-01-12 Thread Nick Hoffman
Randy Harmon wrote: > On 1/11/10 9:22 PM, Nick Hoffman wrote: >>> Cheers, >>> David >>> >> Thanks for that, David. I updated my spec (http://codepad.org/F828X7Fg). >> For some reason though, it's still failing: http://codepad.org/s65Ckubc >&

Re: [rspec-users] Troubles with route_for

2010-01-11 Thread Nick Hoffman
David Chelimsky wrote: > I'd recommend using the route_to matcher that was added in 1.2.9 > instead. > > http://codepad.org/fLcxyA9N > http://rspec.rubyforge.org/rspec-rails/1.2.9/classes/Spec/Rails/Matchers.html#M29 > > It's more reliable, and aligns better with the rspec matchers API. > >

Re: [rspec-users] Troubles with route_for

2010-01-10 Thread Nick Hoffman
Amit Kulkarni wrote: > Nick Hoffman wrote: >> Hey guys. I'm having some trouble with a route spec. In routes.rb , I >> have: >> map.connect 'foods/search/:name', :controller => :foods, :action => >> :search >> >> foods_controller_spe

[rspec-users] Troubles with route_for

2010-01-10 Thread Nick Hoffman
ter reading the rspec-rails 1.2.0 upgrade notes (http://tr.im/K1zx), I haven't been able to figure out what I'm doing wrong. Any hints? Thanks! Nick PS: I'm using 1.2.9 and Rails 2.3.4 . -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] RSpec with Sinatra

2009-08-07 Thread Nick Hoffman
On Fri, Aug 7, 2009 at 9:55 AM, Nick Hoffman wrote: > Hey guys. I'm building an app in Sinatra, and am having some trouble > writing a controller spec. It seems that #get isn't known: > > NoMethodError in 'server shows the index page' > undefined method `get

[rspec-users] RSpec with Sinatra

2009-08-07 Thread Nick Hoffman
27;s of any help: http://pastie.org/574643 Thanks! Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Rspec book review...

2009-07-23 Thread Nick Hoffman
g whole hog with BDD. Just keep at it, and it'll feel like second nature before you know it. You have all of the necessary resources at hand, and you've done lots of research. Now you just need to become experienced with BDD, RSpec, and Cucumber.

Re: [rspec-users] Class method not being stubbed

2009-05-28 Thread Nick Hoffman
would be autoloaded. > > Perhaps the problem lies there somewhere. Hi Rick. I finally had some time to fix this problem, and you were spot on. I moved lib/adsense_heaven_parser.rb to app/models/ad_sense_heaven_parser.rb and everything's smooth now.

Re: [rspec-users] spec for authenticated user

2009-05-28 Thread Nick Hoffman
and whose session isn't being redirected requests HTML from FooBarsController#show , they should be redirected to the sign-up page." Once you have the behaviour of each scenario mapped out, write specs for each scenario. When that's all done, I recommend writing your specs before you write code. -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
ause the file to be named "ad_sense_..."? >  2) the require wouldn't be needed since it would be autoloaded. I thought that everything in lib/ should be autoloaded. When I found that lib/adsense_heaven_parser.rb wasn't being autoloaded, I figure

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
;m trying to say is that I've set a message expectation on AdSenseHeavenParser#parse , which should prevent the method from being called in the first place. -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
tement. The debugger would allow > you to immediately clear things out. Hi Fernando. I'm not sure what you mean by "the code never gets out of this require statement". However, that doesn't really matter. The call to #require shouldn&#x

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
On Sun, May 24, 2009 at 1:10 PM, Rick DeNatale wrote: > On Sun, May 24, 2009 at 12:25 PM, Nick Hoffman wrote: >> Hi guys. I'm setting an expectation on a class method. For some >> reason, the method isn't being stubbed, and the expectation isn'

Re: [rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
se this is being displayed when the spec is run: *** create_keywords_and_associate *** If AdSenseHeavenParser#parse was actually stubbed out, or wasn't called at all, then that line wouldn't be displayed. -Nick ___ rspec-users mailing list rspec-users@

[rspec-users] Class method not being stubbed

2009-05-24 Thread Nick Hoffman
ver, that string shouldn't be printed if AdSenseHeavenParser#parse is stubbed out. I've been beating my head against this for a couple of hours. Any thoughts? Thanks, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-19 Thread Nick Hoffman
ult return value for a stubbed method. > and for the second scenario > template.stub!(:render) #stub render function > template.should_receive(:render) #check if render function was called Mostly! All you need is the call to #should_receive . The call to #stu

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-18 Thread Nick Hoffman
to stub the render call with specific partial name? What I said above about method expectations and method stubs also applies here. You should remove the call to #stub! . However, I'd be inclined to use #should_receive rather than #expect_render : template.should_receive(:

Re: [rspec-users] Testing return value of a block argument

2009-03-16 Thread Nick Hoffman
bit of code to tinker with: http://gist.github.com/79820 > > Thanks in advance, > yun Hi Yun. Have a look at #and_yield , described at http://rspec.info/documentation/mocks/message_expectations.html . Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] OT: AR Default Values

2009-03-05 Thread Nick Hoffman
ick message to let you know that I've used active_record_defaults in the past, and it's been very helpful. Good luck. -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [RSpec][RJS] Problem with specing create.rjs in controller_spec

2009-02-26 Thread Nick Hoffman
integrate_views" is suitable from the perspective of the views being integrated into the execution stack. The name "renders_views" is suitable from the perspective of identifying that a controller example group renders its views. -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing User Agent

2009-02-25 Thread Nick Hoffman
On 25/02/2009, at 9:49 PM, Suprie Leonhart wrote: On Thu, Feb 26, 2009 at 4:39 AM, Nick Hoffman wrote: Hi Suprie. AFAIK, RSpec populates the "request" object in your specs after a controller action is called. Since your "should know if it's from blackberry&quo

Re: [rspec-users] Testing User Agent

2009-02-25 Thread Nick Hoffman
Best Regards Suprie http://suprie.in.ruangkopi.com Hi Suprie. AFAIK, RSpec populates the "request" object in your specs after a controller action is called. Since your "should know if it's from blackberry" example doesn't call a controller action, the "request" object is nil. -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] send_file testing

2009-02-24 Thread Nick Hoffman
On 24/02/2009, at 8:03 AM, vo.x wrote: On 23 Ún, 18:41, Nick Hoffman wrote: On 22/02/2009, at 3:34 PM, vo.x wrote: Hello all, Is there some best practice how to test Rails controller action which is using send_file method? Could you help me please? Vit On 23/02/2009, at 2:43 AM

Re: [rspec-users] send_file testing

2009-02-23 Thread Nick Hoffman
do controller.stub!(:send_file).and_return ... end it "should send the requested file" do controller.should_receive(:send_file).with(...).and_return ... do_get end Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [RSpec] #and_raise

2009-02-18 Thread Nick Hoffman
On 16/02/2009, at 4:12 PM, David Chelimsky wrote: On Mon, Feb 16, 2009 at 1:48 PM, Nick Hoffman wrote: I often use #and_raise like so: @error_message = 'Some error' @sf.should_receive(:shift_time!).and_raise @error_message However, after trying to do this: @argument_error =

[rspec-users] [RSpec] #and_raise

2009-02-16 Thread Nick Hoffman
nt_error and then reading the docs for #and_raise, I realised that #and_raise only accepts a String or exception class. Is there a way to set the exception class and error message? -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://

Re: [rspec-users] Testing misc methods in ApplicationController

2009-02-13 Thread Nick Hoffman
vate methods being called. Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Is #valid? automatically called?

2009-02-13 Thread Nick Hoffman
On 12/02/2009, at 2:59 PM, David Chelimsky wrote: On Feb 12, 2009, at 1:03 PM, Nick Hoffman wrote: Does RSpec automatically call #valid? on ActiveRecord models? For instance, when this example is run: it 'should reject a nil value' do @form = TimeShiftForm.new :file =&

[rspec-users] Is #valid? automatically called?

2009-02-12 Thread Nick Hoffman
RSpec does in fact call #valid? automatically, should we refrain from manually calling #valid? ? -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [RSpec] mock_model not returning a mock

2009-02-12 Thread Nick Hoffman
Ack, that subject is completely wrong! I forgot to update it after re- writing the email. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] [RSpec] mock_model not returning a mock

2009-02-12 Thread Nick Hoffman
passes. Any idea what's going on? I'd really appreciate any help at all, as I've been banging my head against this for a while, now. -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Problem with refresh_specs

2009-02-12 Thread Nick Hoffman
s". 3) Check that each frozen gem has a specification file: $ ls -l vendor/gems/*/.specification 4) Comment out the gem dependencies in environment.rb . I hope that helps! -Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-11 Thread Nick Hoffman
th, the project, and understand best the direction that the project should be going in. Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Rspec approach to test model

2009-02-11 Thread Nick Hoffman
for creating your User object: before(:each) do @user = User.new( :email => 'k...@gmail.com', :password => '1234', # ..etc.. ) end To spec your #activate! , why not do something like this?: it 'should activate the user' do @user.active.should be_false @user.activate! @user.active.should be_true end Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] step definitons to check login

2009-02-09 Thread Nick Hoffman
ion considering them as "not logged-in". I hope that helps. If you have other questions, feel free to post here, or email me privately, or email Authlogic's author; he's quite friendly. Cheers, Nick ___ rspec-users mai

Re: [rspec-users] [RSpec] Setting a gem dep on rspec-rails

2009-02-09 Thread Nick Hoffman
On 08/02/2009, at 4:39 PM, Matt Wynne wrote: On 7 Feb 2009, at 19:02, David Chelimsky wrote: On Sat, Feb 7, 2009 at 12:27 PM, Pat Maddox wrote: On Sat, Feb 7, 2009 at 9:30 AM, Nick Hoffman wrote: With that said, I'm wondering what the accepted way to setup gem dependencies on rspe

Re: [rspec-users] How to spec within a block?

2009-02-08 Thread Nick Hoffman
der => xml_detenteur, :skip_instruct => true, :skip_types => false, :dasherize => false, :except => [:inte_no]}) end end So I want to run specs within some blocks like that. Any recipes? Thank you Rémi Hi Rémi. If you show us what you've written so far, w

Re: [rspec-users] [OT] Object Mother vs Test Data Builder (was Jay Fields' blog on developer testing)

2009-02-08 Thread Nick Hoffman
On 07/02/2009, at 10:45 PM, David Chelimsky wrote: On Sat, Feb 7, 2009 at 8:05 PM, Nick Hoffman wrote: On 07/02/2009, at 1:16 PM, David Chelimsky wrote: On Sat, Feb 7, 2009 at 9:59 AM, Nick Hoffman wrote: When writing Cucumber stories and features for controllers, should you cover

Re: [rspec-users] [OT] Object Mother vs Test Data Builder (was Jay Fields' blog on developer testing)

2009-02-07 Thread Nick Hoffman
On 07/02/2009, at 1:16 PM, David Chelimsky wrote: On Sat, Feb 7, 2009 at 9:59 AM, Nick Hoffman wrote: When writing Cucumber stories and features for controllers, should you cover every edge case? For example, should you write stories that feed bad or missing data to your controllers, or

Re: [rspec-users] [RSpec] Setting a gem dep on rspec-rails

2009-02-07 Thread Nick Hoffman
On 07/02/2009, at 12:30 PM, Nick Hoffman wrote: For a while now, I've had the following in config/environment.rb : config.gem 'haml' config.gem 'rspec', :lib => 'spec' config.gem 'rspec-rails', :lib => 'spec/rails' I just tried run

[rspec-users] [RSpec] Setting a gem dep on rspec-rails

2009-02-07 Thread Nick Hoffman
t the accepted way to setup gem dependencies on rspec and rspec-rails is. Should one not bother? Should the "config.gem" lines go in config/environments/test.rb ? Thanks, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [OT] Object Mother vs Test Data Builder (was Jay Fields' blog on developer testing)

2009-02-07 Thread Nick Hoffman
he spec. Does this sound reasonable? When writing Cucumber stories and features for controllers, should you cover every edge case? For example, should you write stories that feed bad or missing data to your controllers, or should that be left to RSpec? -Nick _

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Nick Hoffman
On 30/01/2009, at 9:49 AM, James Byrne wrote: Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, gems and such? I have run across this suffix a number of times in Ruby and Rails, always in connection with some add-on or extension. In the original context that I encountered '_

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-29 Thread Nick Hoffman
On 29/01/2009, at 4:27 PM, aslak hellesoy wrote: On Thu, Jan 29, 2009 at 10:14 PM, David Chelimsky > wrote: On Thu, Jan 29, 2009 at 2:38 PM, Nick Hoffman wrote: I like "on_failure", as it's consistent with RSpec's output. Eg: 31 examples, 0 failures What could be don

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-29 Thread Nick Hoffman
On 29/01/2009, at 2:18 PM, David Chelimsky wrote: On Thu, Jan 29, 2009 at 1:02 PM, aslak hellesoy > wrote: On Thu, Jan 29, 2009 at 7:25 PM, David Chelimsky wrote: > > > On Thu, Jan 29, 2009 at 12:00 PM, wrote: >> >> Hi all, >> >> I've found myself writing a thing I think is less than optimal,

Re: [rspec-users] Strange message expectation behaviour with Time.now in a find condition

2009-01-29 Thread Nick Hoffman
a few months ago. As David and Aslak suggested, just stub out Time#now . Eg: it 'should do something' do now = Time.now Time.stub!(:now).and_return now User.should_receive(:all).with(:conditions => ['updated_at <= ?', now - 1.day]) User.all(:conditions => ['updated_at <= ?', Time.now - 1.day]) end Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-29 Thread Nick Hoffman
I guess I could get more fine-grained with my it()'s, but I've been preferring a more general statement for it(), that gives the sense without the detail. Any suggestions? Thanks, Randy Hi Randy. I'm not 100% sure what you're ask

Re: [rspec-users] [ANN] The RSpec Book is now in beta

2009-01-29 Thread Nick Hoffman
t, and thanks. Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [RSpec] Error when returning multiple values from a stub

2009-01-28 Thread Nick Hoffman
On 27/01/2009, at 11:03 AM, Nick Hoffman wrote: Hey guys. I've just found some odd behaviour within RSpec 1.1.12 , and would like to know whether this is a bug, or I'm doing something wrong. When I give multiple return values to a stub, like this: SubtitleFile.stub!(:new).and_r

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Nick Hoffman
r default values. The problem that I experienced in this thread will plague the README's example if a non-assignment operation is performed on the attribute. [1] http://svn.viney.net.nz/things/rails/plugins/active_record_defaults/README Thanks again

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Nick Hoffman
On 28/01/2009, at 12:12 PM, Pat Maddox wrote: On Wed, Jan 28, 2009 at 8:30 AM, Nick Hoffman wrote: On 28/01/2009, at 7:50 AM, Zach Dennis wrote: On Tue, Jan 27, 2009 at 2:48 PM, Nick Hoffman wrote: G'day folks. I've been beating my head on this one problem for a couple of

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Nick Hoffman
On 28/01/2009, at 7:50 AM, Zach Dennis wrote: On Tue, Jan 27, 2009 at 2:48 PM, Nick Hoffman wrote: G'day folks. I've been beating my head on this one problem for a couple of hours, and have managed to figure out what's causing it. However, I don't understand why it&#

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-27 Thread Nick Hoffman
On 27/01/2009, at 7:44 PM, David Chelimsky wrote: On Tue, Jan 27, 2009 at 1:48 PM, Nick Hoffman wrote: G'day folks. I've been beating my head on this one problem for a couple of hours, and have managed to figure out what's causing it. However, I don't understand why it

[rspec-users] [RSpec] Cloning objects and leaking state

2009-01-27 Thread Nick Hoffman
xpectation fails in the "should not leak state" example. Any idea what's going on? I'd appreciate any help at all. Thanks, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [RSpec] Error when returning multiple values from a stub

2009-01-27 Thread Nick Hoffman
On 27/01/2009, at 11:03 AM, Nick Hoffman wrote: Hey guys. I've just found some odd behaviour within RSpec 1.1.12 , and would like to know whether this is a bug, or I'm doing something wrong. When I give multiple return values to a stub, like this: SubtitleFile.stub!(:new).and_r

[rspec-users] [RSpec] Error when returning multiple values from a stub

2009-01-27 Thread Nick Hoffman
3389 In code pane #2, if I comment line 13 and uncomment lines 14 and 15, the spec passes. Any idea what's going on? Thanks for your help, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Best way to spec nested modules?...

2009-01-26 Thread Nick Hoffman
estion I'd make is to use more descriptive variable names, though "c1a" might simply be for example's sake, since we're talking about Foo::Baz::C1, etc. Cheers, Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [Cucumber, BDD] When not to use Cucumber?

2009-01-23 Thread Nick Hoffman
. However, if that's not the case, please correct me! Nick ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

  1   2   3   >