Re: [rspec-users] First Model Macro

2011-12-26 Thread Phillip Koebbe
On Dec 26, 2011, at 12:09 PM, Ants Pants wrote: > > > On 26 December 2011 18:01, Phillip Koebbe wrote: > > On Dec 26, 2011, at 10:06 AM, Ants Pants wrote: > > > Hello all, > > > > I trust you are having a good one. > > > > I'm just tryin

Re: [rspec-users] First Model Macro

2011-12-26 Thread Phillip Koebbe
On Dec 26, 2011, at 10:06 AM, Ants Pants wrote: > Hello all, > > I trust you are having a good one. > > I'm just trying out macros and my first one is taken from the RSpec book > which replaces . > > @obj.should_not be_valid > @obj.should have(1).error_on(:attr) > > with the macro >

Re: [rspec-users] problem running tests of helpers

2011-12-13 Thread Phillip Koebbe
On Dec 13, 2011, at 6:39 PM, Jamie Orchard-hays wrote: > Did you ever find a work-around? My Helper Specs are broken in Ruby > 1.9.2, Rails 2.3.14, but fine in Ruby 1.8.7. > > I get > > undefined method `response=' for nil:NilClass > > The nil class is @controller. > > Been pulling my hair o

Re: [rspec-users] preferred place for methods used by both rspec and cucumber?

2011-09-22 Thread Phillip Koebbe
On 2011-09-21 9:35 PM, Patrick J. Collins wrote: Hi, I have some helper methods such as: def mock_omniauth OmniAuth.config.test_mode = true OmniAuth.config.mock_auth[:facebook] = facebook_user end def facebook_user @facebook_user ||= HashWithIndifferentAccess.new(YAML.load(File.rea

Re: [rspec-users] Tests that require a logged in user / session cookie

2011-08-26 Thread Phillip Koebbe
On 2011-08-25 11:42 AM, Andrew Premdas wrote: On 25 August 2011 14:38, Matthias Siegel > wrote: On 25/08/2011, at 11:10 AM, Justin Ko wrote: On Wed, Aug 24, 2011 at 6:40 PM, Matthias Siegel mailto:matthiassie...@gmail.com>> wrote: Hi,

Re: [rspec-users] doesn't rspec check the existence of template file

2011-08-25 Thread Phillip Koebbe
On 2011-08-25 7:04 AM, David Chelimsky wrote: On Aug 23, 2011, at 5:02 AM, foreverman wrote: Hey, I am using rspec (1.3.0) and rspec-rails (1.3.2) for my current rails2 project, I found that in my controller test, rspec doesn't check the existence of view template. For example, it "should re

Re: [rspec-users] [rails] undefined method `model_name' for NilClass:Class

2011-05-31 Thread Phillip Koebbe
On 2011-05-31 1:57 PM, Chris Habgood wrote: The program works when I run it on the server. describe FoodsController do render_views before(:each) do Food.delete_all login_as_admin Food.stubs(:find).with("1").returns(@food = mock_model(Food, :save=>false)) end #des

Re: [rspec-users] Upgrading to rspec-rails version 2.6 causes 'stack level too deep' SystemStackError

2011-05-21 Thread Phillip Koebbe
On 2011-05-19 6:17 PM, Brad wrote: Has anyone else had this problem? Everything was working well with rspec-rails 2.5.0. I gem updated to 2.6.0 and now I get the error: rspec-core-2.6.1/lib/rspec/core/configuration.rb:419: stack level too deep (SystemStackError) This is where it i

Re: [rspec-users] rake spec fails where rake spec:(models|controllers|views) pass

2011-05-19 Thread Phillip Koebbe
I can't explain why, but when I remove --loadby mtime --reverse from spec/spec.opts, rake spec works again. It *might* have something to do with this thread [1], but I don't know. Peace. [1] http://www.ruby-forum.com/topic/1151108 On Apr 23, 2:54 pm, Phillip Koebbe wrote: > I&#

[rspec-users] rake spec fails where rake spec:(models|controllers|views) pass

2011-04-23 Thread Phillip Koebbe
I'm still trying to work into Ruby 1.9.2 and am now experiencing something that makes no sense to me. Using rspec 1.3.2 and rspec-rails 1.3.4 with rails 2.3.11 on ruby 1.9.2-p180, when I $ rake spec:models they all pass. When I $ rake spec:controllers they all pass. When I $ rake spec:views

Re: [rspec-users] Ruby 1.9.2 confusion

2011-04-03 Thread Phillip Koebbe
On 2011-04-03 2:45 PM, Phillip Koebbe wrote: I'm wondering if someone could shed a little light on something for me. I'm trying to get a Rails 2.3.11 project running on Ruby 1.9.2-p180, and the same specs that pass on 1.8.7-p302 don't pass on 1.9.2-p180 if I run them one way,

[rspec-users] Ruby 1.9.2 confusion

2011-04-03 Thread Phillip Koebbe
I'm wondering if someone could shed a little light on something for me. I'm trying to get a Rails 2.3.11 project running on Ruby 1.9.2-p180, and the same specs that pass on 1.8.7-p302 don't pass on 1.9.2-p180 if I run them one way, but do if I run them another way. If I run a particular view s

Re: [rspec-users] routing error for a name-spaced nested controller

2011-02-08 Thread Phillip Koebbe
On 2011-02-05 3:29 PM, slavix wrote: Struggling with nested routing and rspec... When I run spec/controllers/admin/website_users_controller_spec.rb describe Admin::WebsiteUsersController do ... get :index, :website => @website at this line I get: ActionController::RoutingError Exception: No

Re: [rspec-users] Best Practice for Controllers

2011-01-22 Thread Phillip Koebbe
On 2011-01-21 10:25 PM, David Kahn wrote: On Mon, Jan 17, 2011 at 1:43 PM, David Chelimsky > wrote: On Jan 17, 2011, at 10:16 AM, David Kahn wrote: On Mon, Jan 17, 2011 at 9:48 AM, Ants Pants mailto:antsmailingl...@gmail.com>> wrote: Hello

Re: [rspec-users] Best Practice for Controllers

2011-01-18 Thread Phillip Koebbe
> On 17 January 2011 20:43, David Chelimsky wrote: > > > On Jan 17, 2011, at 10:16 AM, David Kahn wrote: > > > On Mon, Jan 17, 2011 at 9:48 AM, Ants Pants > > wrote: > > >> Hello all, > > >> From what I've seen, this type of question doesn't really seem to get an > >> answer on this list as mos

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

2010-11-21 Thread Phillip Koebbe
I had a similar problem in the past (with RSpec 1.x). I tend to create what I call a BaseController in each namespace specifically for shared behavior. The best example of this is class Admin::BaseController < ApplicationController before_filter :require_logged_in before_filter :require

Re: [rspec-users] Trying to spec all models

2010-09-16 Thread Phillip Koebbe
On 2010-09-16 8:24 PM, Ed Howland wrote: On Thu, Feb 11, 2010 at 7:15 AM, Phillip Koebbe wrote: David Chelimsky wrote: On Thu, Feb 11, 2010 at 12:13 AM, Mike Sassakwrote: On Wed, Feb 10, 2010 at 10:17 PM, Phillip Koebbe wrote: When I do script/spec -c -f n spec/models

Re: [rspec-users] bundler and config/initializers/* not loading

2010-08-24 Thread Phillip Koebbe
On 2010-08-24 7:14 PM, David Chelimsky wrote: On Aug 24, 2010, at 12:34 PM, Phillip Koebbe wrote: I am trying to use Bundler on a Rails 2.3.8 project and am having a problem when trying to run my specs. This application was on 2.3.5 until yesterday, and I switched it to 2.3.8 and all specs

[rspec-users] bundler and config/initializers/* not loading

2010-08-24 Thread Phillip Koebbe
I am trying to use Bundler on a Rails 2.3.8 project and am having a problem when trying to run my specs. This application was on 2.3.5 until yesterday, and I switched it to 2.3.8 and all specs passed. But after adding Bundler (0.9.26), rake spec fails because (it appears) files in config/initi

Re: [rspec-users] rspec2 not working with shoulda

2010-08-11 Thread Phillip Koebbe
On 2010-08-11 12:29 PM, Craig Demyanovich wrote: On Wed, Aug 11, 2010 at 12:53 PM, Nadal > wrote: I posted a question on shoulda forum. It is under moderation so I don't have a link yet. To the people who do not use shoulda: How would you write a test fo

Re: [rspec-users] testing 404 redirects in the controller with rspec beta 19

2010-08-09 Thread Phillip Koebbe
On 2010-08-09 1:29 AM, christofferklang wrote: Hello, I'm new to rails and I'm trying to wrap my heads around how to spec controllers using RSpec (using rails 3rc1 and rspec 2.0.0.beta.19). The problem I've run into is when I want to test that my controllers respond with a 404 for unfound r

Re: [rspec-users] Recognising RSpec files in the Textmate bundle

2010-08-08 Thread Phillip Koebbe
On 2010-08-08 6:11 AM, Ashley Moran wrote: On Aug 08, 2010, at 2:17 am, Phillip Koebbe wrote: I have developed a system in which I require model_helper.rb in model specs, controller_helper.rb in controllers, and (you guessed it!) view_helper.rb in view specs. Each of those then require

Re: [rspec-users] Recognising RSpec files in the Textmate bundle

2010-08-07 Thread Phillip Koebbe
On 2010-08-07 5:44 PM, David Chelimsky wrote: On Aug 7, 2010, at 5:28 PM, Ashley Moran wrote: Hi Did the RSpec TMBundle ever have multiple ways of recognising RSpec files? I'm convinced it user to look for "spec_helper" on the first line. I'm pretty sure it never did that. The Ruby bundl

Re: [rspec-users] render_template expectation - surprising pattern matching issue

2010-07-26 Thread Phillip Koebbe
On 2010-07-26 11:12 AM, Timo Rößner wrote: Hey guys, we just found out by accident that rspec seems to apply a pretty confusing mechanism to ensure that a certain template is rendered. To clarify, consider this standard controller spec: # working it 'GET edit' do get :edit, :id =>

Re: [rspec-users] [rails] shoud I test validate_presentence_of series?

2010-07-21 Thread Phillip Koebbe
On 2010-07-21 1:41 AM, Zhenning Guan wrote: Suppose I have a model Forum, have some attributes, title, content, tag.so I do it in Forum model. validates_presence_of :title validates_presence_of :tag validates_presence_of :content. when I added validateds_presence_of, rails will restrict the at

Re: [rspec-users] Data-wise context combination for controller speccing

2010-07-19 Thread Phillip Koebbe
On 2010-07-19 5:38 AM, Wincent Colaiuta wrote: El 19/07/2010, a las 10:58, Matt Wynne escribió: On 18 Jul 2010, at 00:10, David Chelimsky wrote: On Jul 17, 2010, at 1:18 PM, Costa Shapiro wrote: Hello, I've been thinking of how to express my idea in code, but since I've never been involv

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-09 Thread Phillip Koebbe
On 2010-07-09 8:38 AM, Wincent Colaiuta wrote: El 09/07/2010, a las 14:29, Frank J. Mattia escribió: it "should explicitly set created_by" do controller.stub(:current_user) { mock_user } mock_order.should_receive(:created_by=).with(mock_user) post :create end This is my newly working spe

Re: [rspec-users] rspec-rails how to selectively turn on csrf protection for controller specs?

2010-07-08 Thread Phillip Koebbe
On 2010-07-08 12:15 PM, Wincent Colaiuta wrote: El 08/07/2010, a las 18:36, nruth escribió: I'm setting up a Paypal IPN listener and need the create action to not use rails' default CSRF protection. I've got that working fine& test it actually works with cucumber (where I've turned CSRF back

Re: [rspec-users] Testing render :update

2010-06-14 Thread Phillip Koebbe
On 2010-06-14 6:40 PM, Marcelo de Moraes Serpa wrote: Hey guys. I would like to test the following behavior: render :update do |page| page.replace_html 'errors', :partial => 'signup_errors', :locals => { :errors => 'errors'} end } I'm doing: controller.

Re: [rspec-users] How do I improve the readability of my specs

2010-05-26 Thread Phillip Koebbe
On 2010-05-26 10:44 PM, David Chelimsky wrote: ps - there is some irony in the fact that I keep repeating myself on this exact topic on this list. I think I need to write this up in a blog post and point people to that in the future. Now THAT would be DRY. +1 Please do. _

Re: [rspec-users] and_return question

2010-05-07 Thread Phillip Koebbe
On 2010-05-06 9:51 PM, David Chelimsky wrote: On May 6, 2010, at 10:09 AM, Phillip Koebbe wrote: Are these two forms theoretically functionally equivalent: 1) car = stub_model(Car) Car.stub(:new).and_return(car) 2) Car.stub(:new).and_return(stub_model(Car)) I ask because I thought they

[rspec-users] and_return question

2010-05-06 Thread Phillip Koebbe
Are these two forms theoretically functionally equivalent: 1) car = stub_model(Car) Car.stub(:new).and_return(car) 2) Car.stub(:new).and_return(stub_model(Car)) I ask because I thought they were, but just hit something that suggests they are not. I was originally using the first form, but t

Re: [rspec-users] multiple return values with stub

2010-04-30 Thread Phillip Koebbe
On 2010-04-30 11:34 AM, Phillip Koebbe wrote: I have a helper method def login_as(role) user = stub_model(User) user.stub(:is_administrator?).and_return(role == :admin) User.stub(:find_by_id).and_return(user) session[:user_id] = user.id user end

[rspec-users] multiple return values with stub

2010-04-30 Thread Phillip Koebbe
I have a helper method def login_as(role) user = stub_model(User) user.stub(:is_administrator?).and_return(role == :admin) User.stub(:find_by_id).and_return(user) session[:user_id] = user.id user end which has been dandy until yesterday. I am now

Re: [rspec-users] rspec doesnt recognize a custom mime type

2010-04-29 Thread Phillip Koebbe
On 2010-04-29 7:40 AM, jollyroger wrote: Ok, fixed it, in a nutshell: Doesnt work: get :new, :format => :lightbox Works: get :new, :format => 'lightbox' What was really confusing was that in BOTH cases the same URL appeared in the log. Here is my turn on what happened: Internally - whe

Re: [rspec-users] a MockExpectationError problem

2010-04-25 Thread Phillip Koebbe
On 2010-04-25 5:25 PM, Patrick J. Collins wrote: Here is a gist of my code: http://gist.github.com/378778 Use stub when you just want to provide the plumbing. Use should_receive when you are setting an expectation. As an example, you could do Photo.stub(:create) just to provide the method to a

Re: [rspec-users] Controller tests fail to parse route based on resource

2010-04-25 Thread Phillip Koebbe
On 2010-04-25 5:52 PM, Marcelo de Moraes Serpa wrote: Hello list, I have a controller example that looks like this: it 'Should update (PUT /users/:id)' do @attributes = @user.attributes @attributes[:firstname] = "Another one" lambda { put user_url(@user),@attribut

Re: [rspec-users] a MockExpectationError problem

2010-04-25 Thread Phillip Koebbe
On 2010-04-25 4:25 PM, Patrick J. Collins wrote: On Sun, 25 Apr 2010, Phillip Koebbe wrote: See http://gist.github.com/378489 for how I ended up specing a file upload. This isn't the exact same situation, but maybe you will get some ideas that will help. And there may be a better way, but

Re: [rspec-users] a MockExpectationError problem

2010-04-25 Thread Phillip Koebbe
On 2010-04-25 3:43 AM, Patrick J. Collins wrote: Hi everyone, I have a test for importing vcards, and I was finding that each time it was being run, it was generating new photos and since it was using the test database, it was actually overwriting real photos that were being stored in the file

Re: [rspec-users] Spec templates

2010-04-16 Thread Phillip Koebbe
You could always define your own generators with your own templates. I'd probably try that first and see how well it works. Cheers, -foca That's a good idea, foca. Thanks. I'll give it a try. Peace, Phillip ___ rspec-users mailing list rspec-user

[rspec-users] Spec templates

2010-04-15 Thread Phillip Koebbe
David et al, Has anyone ever toyed with the idea of templates for specs? I have a relative consistent way of specing models, controllers, etc, and invariably, I have to delete the stock code that the rspec generator creates and add a bunch of stuff that I always want. I was just thinking it

Re: [rspec-users] Passing get request parameters in an rspec test

2010-04-02 Thread Phillip Koebbe
get 'enrollments', {:id => '1') And, of course, that should be a curly at the end! get 'enrollments', {:id => '1'} Phillip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Passing get request parameters in an rspec test

2010-04-02 Thread Phillip Koebbe
On 2010-04-02 12:16 PM, Matt Kolenda wrote: Hello Please forgive my noobness to rspec. We're all noobs at some point in regard to something. No forgiveness necessary. :) I have a controller method that inspects the params[:id] object and renders a view that depends on the existence of t

Re: [rspec-users] view spec template.base_path

2010-03-26 Thread Phillip Koebbe
On Mar 25, 1:50 pm, Phillip Koebbe wrote: > Right after I sent that message, I discovered I could set a variable > before the initial describe statement and reuse it. This works: > > base_path = 'web/admin/merchants' > describe "#{base_path}/show.html.haml"

[rspec-users] view spec template.base_path

2010-03-25 Thread Phillip Koebbe
I have a helper method def partial_path_for(partial, options = {}) base_path = options[:base_path] || self.template.base_path "_partials/#{base_path}/#{partial}" end and use it in a template (haml) like = render :partial => partial_path_for(:details) I'd like to have a similar helper

Re: [rspec-users] view spec template.base_path

2010-03-25 Thread Phillip Koebbe
On 2010-03-25 1:42 PM, Phillip Koebbe wrote: I have a helper method def partial_path_for(partial, options = {}) base_path = options[:base_path] || self.template.base_path "_partials/#{base_path}/#{partial}" end and use it in a template (haml) like = rende

[rspec-users] Link to current documentation

2010-03-23 Thread Phillip Koebbe
I bookmark the RSpec documentation like http://rspec.rubyforge.org/rspec-rails/1.3.2/ I was wondering if the maintainer of the site (David?) would be willing to create "current" link that would redirect to the appropriate version. This would save people like myself from having to update bookma

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

2010-03-22 Thread Phillip Koebbe
On 2010-03-20 12:17 PM, David Chelimsky wrote: 2. Setup context in before blocks, not expectations We want the example names to express the intent of each example. The before block in the "with valid id' context sets two expectations, and then each example sets one of its own. If "should_not_as

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

2010-03-20 Thread Phillip Koebbe
On 2010-03-20 12:17 PM, David Chelimsky wrote: On Sat, Mar 20, 2010 at 10:19 AM, Phillip Koebbe wrote: I would be glad to help in this way, but it will have to be later today. And instead of using completely made-up code, I'll use some of my real-world code and tests as an ex

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

2010-03-20 Thread Phillip Koebbe
I would be glad to help in this way, but it will have to be later today. And instead of using completely made-up code, I'll use some of my real-world code and tests as an example. I'll gist them later, unless one of the gurus comes along and provides enlightenment for you! I was able to ge

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

2010-03-20 Thread Phillip Koebbe
On 2010-03-20 7:02 AM, Patrick J. Collins wrote: On Sat, 20 Mar 2010, Phillip Koebbe wrote: Welcome to RSpec, Patrick. For some of us, it's pretty rocky at first. I Thank you Phillip for your great explanation... After reading what you wrote, I have a few questions: 1. From

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

2010-03-20 Thread Phillip Koebbe
There is an alternate syntax that I'm using nearly exclusively at this point, which is to pass a block along with the stub() and should_receive() messages: foo.stub(:bar) { "return value" } foo.stub(:bar) { raise SomeError } foo.stub(:bar) { yield "value" } foo.stub(:bar) { throw :v

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

2010-03-20 Thread Phillip Koebbe
Welcome to RSpec, Patrick. For some of us, it's pretty rocky at first. I started using it a couple of years ago with models, and understood that well enough (I think). Then I came to controllers and I just couldn't wrap my mind around it. I gave up for quite some time. When I came back to testi

Re: [rspec-users] stub and should_receive

2010-03-02 Thread Phillip Koebbe
Nevermind. If I would have waited five more minutes before clicking "Send", I would have seen my error. Blech. Phillip Koebbe wrote: What is the expected behavior when a model has both stub and should_receive defined for the same method? I have a helper method which creates an adm

[rspec-users] stub and should_receive

2010-03-02 Thread Phillip Koebbe
What is the expected behavior when a model has both stub and should_receive defined for the same method? I have a helper method which creates an admin "logged in": def stub_user(is_administrator) user = stub_model(User) user.stub(:is_administrator).and_return(is_administrator) User.

Re: [rspec-users] rspec "output which test it is running before running it"

2010-02-25 Thread Phillip Koebbe
rogerdpack wrote: Interesting. It appears that with both specdoc and --format nested, it outputs the test name *after* running it. I would have expected the opposite. Is this expected? Thanks. -r Yes. RSpec needs to know if the test passed or failed so it knows how to color it. At le

Re: [rspec-users] Recall a example inside another (just like in Cucumber)

2010-02-18 Thread Phillip Koebbe
On 18 Feb 2010, at 19:33, Marcelo de Moraes Serpa wrote: Hello guys, I was spec'ing a model and just tried to do something like this it "should create a payment with period_start & period_end set correctly" do it "should create a new payment for an approved transaction"

Re: [rspec-users] Question About Cleaning Up Specs?

2010-02-18 Thread Phillip Koebbe
Joaquin Rivera Padron wrote: those who knows more say the idea is to keep in the example only what is important for the example (but they surely say it even better than me) which is what you are doing +1, greetings, joaquin 2010/2/18 Matt Wynne mailto:m...@mattwynne.net>> On 18 Feb 201

Re: [rspec-users] please help me learn how to use rspec!

2010-02-18 Thread Phillip Koebbe
patrick99e99 wrote: Hi, So-- I am very very new to BDD.. and I am trying to go over and write The best place to start is the RSpec Book. http://www.pragprog.com/titles/achbd/the-rspec-book Peace, Phillip ___ rspec-users mailing list rspec-us

Re: [rspec-users] Trying to spec all models

2010-02-11 Thread Phillip Koebbe
David Chelimsky wrote: On Thu, Feb 11, 2010 at 12:13 AM, Mike Sassak wrote: On Wed, Feb 10, 2010 at 10:17 PM, Phillip Koebbe wrote: When I do script/spec -c -f n spec/models/**/*_spec.rb I get /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/runner/options.rb:283:in

[rspec-users] Trying to spec all models

2010-02-10 Thread Phillip Koebbe
When I do script/spec -c -f n spec/models/**/*_spec.rb I get /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/runner/options.rb:283:in `files_to_load': File or directory not found: spec/models/**/*_spec.rb (RuntimeError) Yet, if I go into irb and do Dir.glob('spec/models/**/*_spec.rb') I

Re: [rspec-users] Testing controller plugin

2010-02-08 Thread Phillip Koebbe
David Chelimsky wrote: The problem I've run into in trying to spec controller extensions in isolation is that Rails controllers are not self-contained objects: they need a bunch of surrounding state set up for them to work properly. The testing facilities that ship with Rails hide that all from y

Re: [rspec-users] Testing controller plugin

2010-02-08 Thread Phillip Koebbe
Matt Wynne wrote: Yeah, you need to convince RSpec that the describe blocks you're using are describing an ExampleGroup that's about a Rails Controller, then it will mix in the right methods for you. I think you can do something like: describe MySpecialTestController, :type => :controller d

Re: [rspec-users] Testing controller plugin

2010-02-07 Thread Phillip Koebbe
Matt Wynne wrote: On 1 Feb 2010, at 15:14, Phillip Koebbe wrote: I have just recently started creating some plugins, mainly of the controller variety. I have been looking for a tutorial or other documentation detailing how to go about testing these plugins with RSpec, but have not yet

[rspec-users] Testing controller plugin

2010-02-01 Thread Phillip Koebbe
I have just recently started creating some plugins, mainly of the controller variety. I have been looking for a tutorial or other documentation detailing how to go about testing these plugins with RSpec, but have not yet found anything helpful. Can anyone point me toward such a thing? Thanks,

Re: [rspec-users] somewhat confused by the help instructions...

2010-02-01 Thread Phillip Koebbe
David Chelimsky wrote: Agreed: http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature Thanks, David. I don't want to sound all gushy or anything, but you have got to be one of the most helpful, courteous, knowledgable people I have encountered in

Re: [rspec-users] somewhat confused by the help instructions...

2010-01-31 Thread Phillip Koebbe
Rick DeNatale wrote: On Sun, Jan 31, 2010 at 4:55 PM, Phillip Koebbe wrote: David Chelimsky wrote: Done: http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature Cool stuff! Does that match the describe groups as well? I would

Re: [rspec-users] somewhat confused by the help instructions...

2010-01-31 Thread Phillip Koebbe
David Chelimsky wrote: Done: http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature Cool stuff! Does that match the describe groups as well? I would like to be able to run all of the examples in either "first group" or "second group". Will it

Re: [rspec-users] Something like tags in cucumber

2010-01-18 Thread Phillip Koebbe
David Chelimsky wrote: On Mon, Jan 18, 2010 at 9:06 AM, Phillip Koebbe wrote: In cucumber, I use tags in a very simple, yet helpful (to me) way: to number my scenarios. For example: @1 Scenario: This is a scenario @2 Scenario: This is another scenario @3 Scenario: You get the idea

[rspec-users] Something like tags in cucumber

2010-01-18 Thread Phillip Koebbe
In cucumber, I use tags in a very simple, yet helpful (to me) way: to number my scenarios. For example: @1 Scenario: This is a scenario @2 Scenario: This is another scenario @3 Scenario: You get the idea This allows me to focus in on a single scenario quite easily while I'm working on it.

Re: [rspec-users] Testing .Net Newbie

2010-01-14 Thread Phillip Koebbe
John Polling wrote: Already reading that one thanks :-) It is a good book and it's helping me get my head around it all. It's just a case of understanding when to develop using Cucumber and when to user RSpec on it's own. I think this will come with experience. John Others can explain it

Re: [rspec-users] Testing .Net Newbie

2010-01-14 Thread Phillip Koebbe
John Polling wrote: Generally what I do is drive all my individual classes out using NUnit and Rhino.Mocks and then do the acceptance testing later with FitNesse. I think this is the part that I'm confusing myself with as most Cucumber information talks about using scenarios to drive the code

Re: [rspec-users] nested steps

2010-01-12 Thread Phillip Koebbe
> > You do realise you can already nest contexts don't you? That makes   > much more sense to me than what you've suggested. > Hi Roger, Here's an example of nesting contexts that Matt is talking about: http://gist.github.com/275798 Peace, Phillip __

Re: [rspec-users] get to a different controller

2010-01-07 Thread Phillip Koebbe
To all involved, Great discussion! Thank you so much for taking the time out of your busy lives to contribute. Please believe me when I say that I appreciate it *very* much! Here is the latest version of my code: http://gist.github.com/269544 I like the idea of shared examples (trying to use th

Re: [rspec-users] get to a different controller

2010-01-06 Thread Phillip Koebbe
Wincent Colaiuta wrote: Well, there is more than one way to skin a cat, but the thing I like about my proposed solution is that: - the specification of the behavior appears in the "describe" block that corresponds to the controller where the behavior is implemented - but given that the i

Re: [rspec-users] get to a different controller

2010-01-06 Thread Phillip Koebbe
Wincent Colaiuta wrote: I test inherited stuff with shared behaviors. It might be something you could use here. Basically, I have a bunch of behavior in my ApplicationController, for example, and in my spec/controllers/application_controller_spec.rb file I have a bunch of blocks like this

Re: [rspec-users] get to a different controller

2010-01-05 Thread Phillip Koebbe
Subclass it in your spec with class TestController < Admin::BaseController def index end end ...then use the TestController in your tests for Admin::BaseController. That might mean you'll need to add special routing for TestController which is annoying but can be done. Thanks, Matt. Be

Re: [rspec-users] get to a different controller

2010-01-05 Thread Phillip Koebbe
Pat Maddox wrote: The spec has Admin::BaseController as the described type. So of course it's going to test against that. If you want to test a different class, you need to describe that instead! Hi Pat, Right. But, I'm not really wanting to test a different class. My intention is to pu

[rspec-users] get to a different controller

2010-01-05 Thread Phillip Koebbe
I'm trying to implement a base controller that other controllers descend from, and am having a bit of difficulty in testing the sole "feature" of the base controller. http://gist.github.com/269544 In the "not redirecting when user is an admin" context, I keep getting an error that "no action

Re: [rspec-users] Loading numerous data structures from YAML files

2010-01-02 Thread Phillip Koebbe
On Jan 2, 5:17 am, Peter Hicks wrote: > > How best should I tackle this?  Where should I put the YAML files and is > there any functionality in RSpec that will help?  Should I roll my own > "load test data" code and present that to the test code? > > Best wishes, > > Peter Hi Peter, Have you rea

Re: [rspec-users] Private method in custom module

2009-12-31 Thread Phillip Koebbe
David, On Dec 31, 2:21 pm, David Chelimsky wrote: > Make sense? > Yes. Thanks for taking the time to explain! Peace, Phillip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Private method in custom module

2009-12-31 Thread Phillip Koebbe
Hi David, First, thanks for the suggestion. I like that better. Second, my motivation for doing this was born out of not being able to do something I wanted to do in Remarkable. However, as I was trying to explain what it was I wanted to do, I just discovered how to do it in Remarkable. So, the i

[rspec-users] Private method in custom module

2009-12-31 Thread Phillip Koebbe
I have a module of custom examples, such as module ControllerHelperMethods module MyExampleGroupMethods def should_set_the_body_id(body_id) it "should set the body id to '#{body_id}'" do assigns[:body_id].should == bod

Re: [rspec-users] rspec controller action list

2008-04-08 Thread Phillip Koebbe
Phillip Koebbe wrote: > > Namatra, Sorry, I spelled your name wrong. Namrata Peace, Phillip -- 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] rspec controller action list

2008-04-08 Thread Phillip Koebbe
I'm a complete rSpec newbie, so I might be stepping in somewhere that I don't belong, but... Namatra, you said earlier that you were stubbing during setup, and you shared the before_post method. In the spec, though, you are going a :get. I'm not familiar with testing controllers yet (just get