Re: [rspec-users] RSpec Book(s) on the radar

2008-08-29 Thread matt
+1! Sent from my Verizon Wireless BlackBerry -Original Message- From: "Rick DeNatale" <[EMAIL PROTECTED]> Date: Fri, 29 Aug 2008 18:57:37 To: rspec-users Subject: Re: [rspec-users] RSpec Book(s) on the radar ___ rspec-users mailing list rspe

Re: [rspec-users] [Q] testing WIN32OLE_EVENT callbacks

2009-08-27 Thread Matt Wynne
chniques: http://xunitpatterns.com/ http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052 does that help? Matt ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [Q] testing WIN32OLE_EVENT callbacks

2009-08-27 Thread Matt Wynne
On 27 Aug 2009, at 17:02, Chuck Remes wrote: On Aug 27, 2009, at 10:12 AM, Matt Wynne wrote: On 26 Aug 2009, at 19:57, Chuck Remes wrote: I'm trying to setup some specs (really just assertions) that verify some callbacks are executed in response to COM events. In the WIN32OLE_

Re: [rspec-users] Using "with(params)" with stubs make any sense?

2009-08-30 Thread Matt Wynne
On 28 Aug 2009, at 19:44, Marcelo de Moraes Serpa wrote: Hello list, Since stubs don't set expectations, do we have any use-case where stubbing like this makes sense: @mock.stub!(:method).with(anything()).and_return(@collection). It is clear that and_return is the value from stubbing, but

Re: [rspec-users] Using ActiveRecord without Rails

2009-09-01 Thread Matt Wynne
On 1 Sep 2009, at 19:44, Rick DeNatale wrote: On Tue, Sep 1, 2009 at 1:51 PM, Carl Graff wrote: Of less importance: Actually I have considered creating/converting these integration applications as full blown Rails applications since they definitely have a model and controller aspect and

Re: [rspec-users] Fixture replacement vs mock model

2009-09-01 Thread Matt Wynne
therefore more fun) just to give it up and hit the database. Fixture replacements are also invaluable for writing acceptance tests in Cucumber. cheers, Matt ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/list

Re: [rspec-users] Nested Partials

2009-09-03 Thread Matt Wynne
want to spec? cheers, Matt +447974 430184 m...@mattwynne.net http://mattwynne.net ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] controller specs with non-RESTful routes

2009-09-14 Thread Matt Wynne
tead to test this request? Looks about right to me. Must be something silly that you've missed, but I'm afraid I can't see it. cheers, Matt +447974 430184 m...@mattwynne.net http://mattwynne.net ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Need Help

2009-09-22 Thread Matt Wynne
cukes.info - there are plenty of links there that should help you. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Need Help

2009-09-25 Thread Matt Wynne
er: it's poorly written and has some inaccurate content. I would recommend the screencasts on the Cucumber homepage: http://cukes.info/ Particularly this one: http://railscasts.com/episodes/155-beginning-with-cucumber cheers, Matt http://mattwynne.net

Re: [rspec-users] Need immeadiate help

2009-09-29 Thread Matt Wynne
-introduction-to-rspec-part-i/ cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Grabbing the controller name before a new test case

2009-10-01 Thread Matt Wynne
block. Any help is greatly appreciated. Can't remember exactly, but it's something like self.described_type cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Running a specific row in cucumber example table

2009-10-02 Thread Matt Wynne
rs mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Running a specific row in cucumber example table

2009-10-05 Thread Matt Wynne
rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Matt Wynne
doing too much in your class). Yup. Sprout class[1] works for me, every single time. [1]http://xunitpatterns.com/Sprout%20Class.html cheers, Matt +447974 430184 m...@mattwynne.net http://mattwynne.net ___ rspec-users mailing list rspec-users@rubyforge

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Matt Wynne
On 14 Oct 2009, at 22:33, Matt Wynne wrote: On 14 Oct 2009, at 20:49, Scott Taylor wrote: On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like this: You have a few options: 1. Make the

Re: [rspec-users] Help me with Controllers spec

2009-10-16 Thread Matt Wynne
ding SQL like this in a controller is considered a bit of an anti-pattern. You would be better off (and, funnily enough, find the mocks a lot easier to write) if you dreamed up a new method on Brand, something like Brand.paginage_for_name and pushed the logic t

Re: [rspec-users] How can I spec protect method

2009-10-21 Thread Matt Wynne
local variable update_successful. If anyone can help me. Cheers EM -- View this message in context: http://www.nabble.com/How-can-I-spec-protect-method-tp25995877p25995877.html Sent from the rspec-users mailing list archive at Nabble.com. ___ rspec-use

Re: [rspec-users] Stub that returns hash values

2009-10-21 Thread Matt Wynne
e same thing myself... but I figured if my suspicions were right, a fallout problem would be posted soon enough :) Ashley ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Matt Wynne
sers ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Problem with before filters

2009-11-02 Thread Matt Wynne
rs. Filters are just methods that get called implicitly by the controller. RSpec's mocking framework doesn't handle them in any special way (nor does any test double frameowrk that I'm aware of). Stubs return values. They do not set state on the object in question

Re: [rspec-users] [BDD] View specs and cucumber -- duplication of effort?

2009-11-09 Thread Matt Wynne
pleasure in deleting each time we replaced them with a broad-brush cuke. What we missed of course was the design guidance we could have had all along if only we'd listened to the tests... [1]http://www.songkick.com/artists/395944-radiohead cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Display Rspec output in an html file

2009-11-09 Thread Matt Wynne
mat html:spec/a.html. After adding this code i ran the spec using rake spec:models RAILS_ENV=test but what i think that if we add something in spec.opts then running command for models is different. Please suggest how to display output in html using rake command rake spec:models -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users Do you get an error message? I don't see one here. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] describe "RSpec's documentation" do

2009-11-09 Thread Matt Wynne
d make a terrific use case for us to support. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Display Rspec output in an html file

2009-11-09 Thread Matt Wynne
ne number to look at? cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] rspec-rails gem changing connection adapter

2009-11-18 Thread Matt Wynne
an you check the value of RAILS_ENV before and after the connection adapter gets changed? There are plugins and various other things (including an old version of rspec-rails) that stomp on RAILS_ENV when they load. That might be the problem. cheers, Matt +447974 430184 m...@mattwynne

Re: [rspec-users] Cucumber Cygwin

2009-11-24 Thread Matt Wynne
blem on Cuke but it does not seem to have got past the moderator (at least it has not appeared). Everyone head over to... http://groups.google.com/group/cukes/browse_thread/thread/de6e8cdf8585f9ca cheers, Matt http://mattwynne.net +447974 430184 ___

Re: [rspec-users] Introductory recommendations?

2009-11-25 Thread Matt Wynne
jon -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.or

Re: [rspec-users] Stubbing helper methods in controller specs when integrate_views is On

2009-11-26 Thread Matt Wynne
do that for you. (3) Use rspec-rails' stub_model method to build the mock object, which creates a real model object instance (like FactoryGirl would) except with the database connection crippled. Okay that was three options. cheers, Matt http://mattwynne.net +447974 430184 __

Re: [rspec-users] how to test a observer model?

2009-11-26 Thread Matt Wynne
an test it. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] spork doesn't find helpers

2009-11-28 Thread Matt Wynne
you point me the right direction please? Thanks, Martin ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyfor

Re: [rspec-users] Custom Matcher and Webrat methods

2009-12-09 Thread Matt Wynne
then the method should execute in the context that can see the binding, so you can pick it up and pass it into the matcher class at that point. Make sense? cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-

Re: [rspec-users] New RSpec methods to Object proposal: should_all and should_none

2009-12-09 Thread Matt Wynne
@user = Factory(:user, :admin => true) end it "should be allowed to access the URL" end etc. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Custom Matcher and Webrat methods

2009-12-10 Thread Matt Wynne
On 10 Dec 2009, at 00:53, Rodrigo Rosenfeld Rosas wrote: Matt Wynne escreveu: On 8 Dec 2009, at 22:04, Rodrigo Rosenfeld Rosas wrote: I would like to be able to write a custom matcher so that I could call this test, for instance: @user.should be_allowed_to_visit(url

Re: [rspec-users] RSpec wire protocol Was:Re: describe "RSpec's documentation" do

2009-12-11 Thread Matt Wynne
On 9 Dec 2009, at 00:09, Ed Howland wrote: Matt, I was facinated to read the email thread on Cuke's wire protoccol. You guys collaborated well. I have been working on my own to develop a similar protocol for RSpec. It is totally external to RSpec right now and very primitive. Wh

Re: [rspec-users] Cuke4PHP Was: RSpec wire protocol Was:Re: describe "RSpec's documentation" do

2009-12-11 Thread Matt Wynne
tocol as I explained. Dragging the might of IIS around in order to test a winforms app, for example, would be pretty bonkers IMO. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Matt Riches
Within my project, I have a number of models that have additional methods within them other than those provided by active record. as an example (to keep it short and sweet) class foo < ActiveRecod::Base def status "New Record" end def reset "Reset" end end in my spec file I have req

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Matt Riches
erewhon', :town=> 'town', :county=>'county', :postcode =>'AB12 3CD', :user_id => 1, :lat=>1.01, :lng=>2.02, :status=>Address::JUST_REGISTERED, :route_id=>1 } end it "should have a status of deleted after reset" do @ad

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Matt Riches
? Is there some way of supressing the warnings, or making the constants only get assigned once? (Maybe another class that just implements the constants?) Regards Matt 2009/12/14 Vishu Ramanathan > This should have been the giveaway > >> undefined method 'status' for

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Matt Riches
Yup, I did. Thanks all. (unless anyone has any comments on the constants question I just asked in a previous post?) Regards Matt 2009/12/14 Tom Stuart > On 14 Dec 2009, at 21:28, Matt Riches wrote: > > describe Address do > > #Test Fixture - Before Each test Create a Stan

Re: [rspec-users] spec'ing controllers

2009-12-16 Thread Matt Wynne
ber. Your observation about specs passing when mocks are wrong is a common one, and one I remember struggling with when I first learned TDD, but again as you learn to trust Cucumber you'll find that this is OK. cheers, Matt +447974 430184 m...@mattwynne.net http://mattwynne.net

Re: [rspec-users] spec with user culture

2009-12-23 Thread Matt Wynne
.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman

Re: [rspec-users] be_true and be_false are suddenly undefined

2009-12-24 Thread Matt Wynne
= ExtractReport.find_by_file_name(basename) count = @file.record_count.to_i - 2 # count includes header and trailer @file.should have(count).items end ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo

Re: [rspec-users] DB does not reset between runs

2009-12-27 Thread Matt Wynne
c-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Submitting a Custom Matcher: gem or other method?

2009-12-31 Thread Matt Wynne
On 30 Dec 2009, at 22:31, Ashley Moran wrote: Wasn't expecting you to drop everything and build a matcher hosting platform :) I think he should. It is Christmas, and it's not like David ever does anything else for the community ;) cheers, Matt http://mattwynne.net +447

Re: [rspec-users] describe "RSpec's documentation" do

2010-01-05 Thread Matt Patterson
On 9 Nov 2009, at 22:03, Matt Wynne wrote: > > On 6 Nov 2009, at 12:49, David Chelimsky wrote: > >> In the long run, what I'd like is the following: >> >> * Cucumber features that ship with RSpec become the authoritative end-user >> documentation. This is

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

2010-01-05 Thread Matt Wynne
rough. How do I do that? Thanks, Phillip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] describe "RSpec's documentation" do

2010-01-06 Thread Matt Wynne
On 5 Jan 2010, at 12:17, Matt Patterson wrote: On 9 Nov 2009, at 22:03, Matt Wynne wrote: On 6 Nov 2009, at 12:49, David Chelimsky wrote: In the long run, what I'd like is the following: * Cucumber features that ship with RSpec become the authoritative end-user documentation. Th

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

2010-01-07 Thread Matt Wynne
module to prove that the module is mixed in and working, but most of the specs for the behaviour of that module itself will live alongside the module and run only once. As David said earlier there are strengths and weaknesses to both approaches so you have to find your own path here. I j

Re: [rspec-users] describe "RSpec's documentation" do

2010-01-07 Thread Matt Patterson
On 7 Jan 2010, at 00:53, Matt Wynne wrote: > On 5 Jan 2010, at 12:17, Matt Patterson wrote: > >> I've been looking at the documentation again recently, and I'd be happy to >> start work on this, particularly if Matt W is wanting to look at the >> cucumber en

Re: [rspec-users] Stubbing through multiple layers

2010-01-09 Thread Matt Wynne
o/rspec-users ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] nested steps

2010-01-12 Thread Matt Wynne
list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Message expectation that verifies result of passed block

2010-01-28 Thread Matt Wynne
nt OO design could really help this whole situation, and it's something I'm planning on tackling down the road For now, I'm just trying to push things in the right direction, and I _think_ the .with_a_block_yielding(value) or .with(block_yielding(value)) argument verification

Re: [rspec-users] Message expectation that verifies result of passed block

2010-01-28 Thread Matt Wynne
x27;m just trying to push things in the right direction, and I _think_ the .with_a_block_yielding(value) or .with(block_yielding(value)) argument verification would help me do that. Thanks for your time! Paul ___ rspec-users mailing list rspec-users@ru

Re: [rspec-users] testing controllers using cucumber

2010-01-29 Thread Matt Patterson
ame("Joe").should_not be_nil end > In this how i need to call the users controller and in that create > method. > Also i searched in the net but didn't found any examples for cucumber > testing controllers. There are lots of example

Re: [rspec-users] Can I set an expectation that a method invokes super?

2010-01-30 Thread Matt Patterson
type situation the right stuff happens across the whole stack. HTH Matt -- Matt Patterson | Design & Code | http://www.reprocessed.org/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

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

2010-01-30 Thread Matt Wynne
g list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184

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

2010-02-01 Thread Matt Wynne
e.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing controller plugin

2010-02-01 Thread Matt Wynne
helpful. Can anyone point me toward such a thing? Create a controller in your specs which uses the plugin in an exemplary way, then asserts the behaviour of that controller. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list

Re: [rspec-users] Passing parameters to Rspec scripts

2010-02-03 Thread Matt Wynne
ny help with this is greatly appreciated. I still have much to learn about Rspec, but so far this seemingly simple task has me stumped. Thanks ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] When to use Factories, Mock Models, Mocks & Stubs

2010-02-03 Thread Matt Wynne
rtion, and it's usually better to have one assertion per example. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Best practices to managing RSpec code for very large projects?

2010-02-04 Thread Matt Wynne
atter if you don't also do something like this. Good luck. -- J. B. (Joe) Rainsberger :: http://www.jbrains.ca :: http://blog.thecodewhisperer.com Diaspar Software Services :: http://www.diasparsoftware.com Author, JUnit Recipes 2005 Gordon Pask Award for contribution to Agile practice :: Agil

Re: [rspec-users] Testing controller plugin

2010-02-08 Thread Matt Wynne
On 8 Feb 2010, at 02:34, Phillip Koebbe wrote: 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

Re: [rspec-users] Testing controller plugin

2010-02-08 Thread Matt Wynne
On 8 Feb 2010, at 16:53, David Chelimsky wrote: On Mon, Feb 8, 2010 at 11:58 AM, Phillip Koebbe > wrote: 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

Re: [rspec-users] OT: Identifying unused code?

2010-02-11 Thread Matt Wynne
over that code, or just remove the unused code and let the specs tell me themselves. Pair programming is also an excellent weapon against slop, as you'll have at least double the confidence that the code you're looking at is indeed unused, and double the courage to de

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

2010-02-18 Thread Matt Wynne
t I do. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

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

2010-02-18 Thread Matt Wynne
into a before block? Cheers, Marcelo. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Do you still Write Tests First on code that is churning hard?

2010-02-19 Thread Matt Wynne
o write a spike, but make sure everyone on your team understands the distinction between that and production code. cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Suggested shorthand for and_return when stubbing

2010-02-20 Thread Matt Wynne
me.stub(:name => 'Matt') That's as opposed to me.stub(:name).and_return('Matt') Thoughts? cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Suggested shorthand for and_return when stubbing

2010-02-20 Thread Matt Wynne
On 20 Feb 2010, at 23:22, David Chelimsky wrote: On Sat, Feb 20, 2010 at 4:09 PM, Matt Wynne wrote: I keep wanting to do this, and I don't think it's possible so I thought I'd suggest it. Similarly to the way I can specify stub values as hash key/value pairs when cons

[rspec-users] Best approach to spec'ing this

2010-02-22 Thread Matt Riches
lling some seed data in form the database? Thanks Matt ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Best approach to spec'ing this

2010-02-22 Thread Matt Riches
> > > I am hoping that this is an easy question to answer! > > > > I have 2 models, related via an association model, such that models a and > b use has_many to refer to each other, and also the association. > > has_many :through with an extra table, or HABTM? > > Im home now and dont have the code

Re: [rspec-users] Module instance variable remains set

2010-02-22 Thread Matt Wynne
ry about leaky state there either. With kind regards, Harm ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 _

Re: [rspec-users] Shared Helpers

2010-02-23 Thread Matt Wynne
describe "an entry" do before @entry or raise("You need to set @entry to use this shared example group") end end It's not great, but it makes the shared example group a little more self-documenting than if you just shared the instance vari

Re: [rspec-users] Is there a way to terminate a long running spec job...

2010-02-23 Thread Matt Wynne
matters to output the failures into another file, and then just tail that file for your meaningful output? cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] where can I find a discusion happened earlier

2010-02-24 Thread Matt Wynne
list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

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

2010-02-25 Thread Matt Wynne
list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] RSpec framework question

2010-03-02 Thread Matt Wynne
recommend paring this back to a much simpler example, getting that working, then building up from there. I'm also not sure why you're using the SUT to generate the tests, but that's for another thread... cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Disabling database access in controller specs

2010-03-03 Thread Matt Wynne
idea? Thanks, Stefan ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-

Re: [rspec-users] Insufficient database clean-up between specs

2010-03-16 Thread Matt Wynne
in your suite, that code is _not_ run in a transaction and it is up to you to destroy any data you create. 3. If you make any dirty little direct SQL calls (using ActiveRecord::Base.connection.execute) while the example runs, that will commit the transaction so it's won't be rolle

Re: [rspec-users] continuing on my quest to learn rspec...

2010-03-23 Thread Matt Wynne
spec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] setting partial stub for just one value and letting obj handle the rest

2010-04-01 Thread Matt Wynne
Can you not use a mock for the other instance of User too? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184

Re: [rspec-users] setting partial stub for just one value and letting obj handle the rest

2010-04-01 Thread Matt Wynne
On 1 Apr 2010, at 23:12, drewB wrote: David, thanks for your response. Matt, I totally hear you. In this contrived example, you probably could but in the project I am working on it would be very difficult. One of the challenges of joining a project already in progress... I have felt that

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

2010-04-02 Thread Matt Kolenda
e variables. My question is "How do I pass in the params[:id] parameter to the get 'enrollments' line?" Thanks in advance Matt ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Can I use mocking in this way?

2010-04-04 Thread Matt Wynne
;m pretty sure there's always a way around it. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspe

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

2010-04-06 Thread Matt Kolenda
Phillip - Yes, that worked, thanks a million! Matt On Fri, Apr 2, 2010 at 10:53 AM, Phillip Koebbe wrote: > > get 'enrollments', {:id => '1') >> > > And, of course, that should be a curly at the end! > >

Re: [rspec-users] [Cucumber:4066] Cucumber vs, RSpec

2010-04-21 Thread Matt Wynne
this group, send email to cukes+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cukes?hl=en . cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] testing against a live environment

2010-04-27 Thread Matt Wynne
ation for this too. martin ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.or

Re: [rspec-users] more rspec questions

2010-04-27 Thread Matt Wynne
ed at length on this list before. Here's a good example: http://groups.google.com/group/rspec/browse_thread/thread/9e3d879f712ce4f2/030af755918967dd Patrick J. Collins http://collinatorstudios.com ___ rspec-users mailing list rspec

Re: [rspec-users] Future of RSpec Integration Testing

2010-04-29 Thread Matt Wynne
hings that the rails generators put in ./test/integration, or something else? cheers, Matt http://mattwynne.net +447974 430184 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] What are the common causes of rspec hanging?

2010-05-10 Thread Matt Wynne
You might want to try running the specs with --format specdoc so you can do a better post mortem. Also remember you can look at log/test.log to see what was happening when it hung. On 8 May 2010, at 20:59, RFine wrote: > I'm responsible for a relatively large RoR application, and have been > st

Re: [rspec-users] Versions of RSpec & Rails

2010-05-12 Thread Matt Riches
I could be wrong, Im new to rspec and RoR myself, but I can see the line "** Execute db:abort_if_pending_migrations" before teh abort happens. Have you rune rake db:migrate recently? Matt On 12 May 2010 14:46, Sascha Popovic wrote: > Hello. > I'm new to ROR and i'

Re: [rspec-users] First Post (Best Practices)

2010-05-13 Thread Matt Wynne
On 13 May 2010, at 12:41, Ants Pants wrote: > Hello everyone, Hello and welcome :) > I'm just working my way through the RSpec/Cucumber book, I love the tool but > not so much the learning curve :( > > Starting with my first view, is it okay for me, in the BDD world, to do the > following or

Re: [rspec-users] Quickcheck testing framework

2010-05-18 Thread Matt Wynne
On 16 May 2010, at 18:54, Scott Taylor wrote: > > Hey all, > > I'm wondering if anyone has any experience with an automated test-case > generation tool like Quickcheck (for erlang/haskell). I'd be interested in > hearing any impressions, war stories, or dev workflows regarding a tool like >

Re: [rspec-users] How to separate unit and integration spec suites?

2010-05-20 Thread Matt Wynne
On 19 May 2010, at 22:11, Myron Marston wrote: > On my current rails project we're using both rspec and cucumber. > We've been diligent about keeping our specs as true unit tests, using > nulldb and mocking/stubbing to disconnect the specs from the database > and keep each spec focused on the cla

Re: [rspec-users] old crumbly rspec

2010-05-25 Thread Matt Wynne
Cursory look at that blog post seems like it's covered most of what's in this talk, but worth mentioning anyway, it's good: http://pure-rspec-rubynation.heroku.com/ http://video2010.scottishrubyconference.com/show_video/3/1 On 24 May 2010, at 10:33, Andrew Premdas wrote: > Hi List, > > Being p

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

2010-05-26 Thread Matt Wynne
e to that in the future. Now THAT would be DRY. Great explanation David. There's a slightly different point about this, which is that in the BDD world we aspire to build things from the "outside in". These splendid methods that automatically generate specdoc from code are great in simple cases, but very often it's advisable to start by writing a plain-english description of what you're setting out to do before you write any code. Jumping straight in to writing the code (the solution) without clearly having stated the goal can mean you miss a chance to get insights into your design. cheers, Matt http://blog.mattwynne.net ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Understanding how to better use stub! and stub_chain

2010-06-01 Thread Matt Wynne
Did you try looking at the specs for any examples? I imagine there'd be a couple... ;) Joseph DelCioppio wrote: >I've been looking through the RSpec source to better understand how >RSpec works and I've got a question about the functionality of stub!. >I noticed that you can pass a symbol to st

Re: [rspec-users] (no subject)

2010-06-07 Thread Matt Wynne
suggestions. Have you seen and_yield? I can't quite get my head around what you're trying to do, but it might help anyway: http://rspec.info/documentation/mocks/message_expectations.html cheers, Matt > > -Ben > > ___ > rsp

Re: [rspec-users] mock assertions on block parameters

2010-06-07 Thread Matt Wynne
On 7 Jun 2010, at 15:56, Ben Butler-Cole wrote: > On 7 June 2010 15:25, Matt Wynne wrote: > > Have you seen and_yield? I can't quite get my head around what you're trying > to do, but it might help anyway > > Thank you, I have. My understanding is that #and_yield

  1   2   3   4   5   6   7   8   >