Re: [rspec-users] autospec not detecting new files

2009-11-20 Thread Stephen Eley
On Fri, Nov 20, 2009 at 1:35 PM, Andy Koch wrote: > > Autospec doesn't run the "perforce_logs...spec.rb" files.  As shown > here... Random theory: try renaming the files temporary to remove the word "log" from the name. I'm wondering if it might be a wildcard matcher somewhere in the chain that

Re: [rspec-users] autospec not detecting new files

2009-11-19 Thread Stephen Eley
On Fri, Nov 20, 2009 at 1:02 AM, Andy Koch wrote: > > I have a project where autospec is not adding new files to it's test > list. Autotest (which autospec is really just a wrapper around) builds its file list when it initializes. After that its looping is pretty specific. If you want to refres

Re: [rspec-users] ruby file.spec?

2009-11-12 Thread Stephen Eley
On Thu, Nov 12, 2009 at 7:34 PM, rogerdpack wrote: > perhaps this has been discussed before and you can point me to the > right thread, but is it possible to run specs from the command line > using just ruby? > ruby arguments_spec.rb > > and it "just run" (like test/unit seems to)? What happens w

Re: [rspec-users] ruby file.spec?

2009-11-12 Thread Stephen Eley
On Thu, Nov 12, 2009 at 8:36 PM, Zach Dennis wrote: > > You want to use "spec" to run files directly. If you have your heart > set on running files from "ruby" then you'll need to load > "spec/autorun" to actually execute the specs. After giving the original querent a hard time, it surprises me t

Re: [rspec-users] better documentation?

2009-11-12 Thread Stephen Eley
On Thu, Nov 12, 2009 at 7:14 PM, rogerdpack wrote: > >> I really like what Aslak and the Cucumber community have done by >> making cukes.info more high level and building up more extensive >> documentation on the github wiki, so I'd rather put energy into >> beefing up the github wiki than improve

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

2009-11-07 Thread Stephen Eley
On Sat, Nov 7, 2009 at 9:31 PM, David Chelimsky wrote: > > As for internals, my goal for the Cucumber features is to provide an > executable set of documentation for end users to understand how to use > RSpec. Not so much to expose internals, which I think is better addressed in > the RSpec code e

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

2009-11-04 Thread Stephen Eley
On Wed, Nov 4, 2009 at 3:24 PM, Andrew Premdas wrote: > > Personally I now think nested steps are evil - but thats another story :) It sounds like an entertaining one. I'd love to hear why sometime. (Though whether the right place for it would be here or the Cucumber list, I couldn't say.) > H

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

2009-11-04 Thread Stephen Eley
On Wed, Nov 4, 2009 at 10:56 AM, Andrew Premdas wrote: > > Putting lots of > view details in the features (and I should see a wibble field etc. ...) > pollutes this map with clutter that is not relevant to the "business" > context. So view specs seem like a really good place to spec all this > det

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

2009-10-29 Thread Stephen Eley
On Thu, Oct 29, 2009 at 10:19 AM, David Chelimsky wrote: > > Everything in between falls along a spectrum, and it's up to you to find the > sweet spot, which _will_ vary from team to team, project to project, and > even view to view. Here's a discussion on another forum in which nearly the exact

Re: [rspec-users] at_exit in spec file?

2009-10-29 Thread Stephen Eley
On Thu, Oct 29, 2009 at 6:18 AM, Ashley Moran wrote: > > But, is it me, or is rspec-users quieter than it used to be?  I'm sure when > I was learning the volume of questions was much higher.  Are there fewer > people using RSpec?  Or is it just more stable and well-documented now? >  (Maybe I'm ju

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

2009-10-28 Thread Stephen Eley
On Wed, Oct 28, 2009 at 9:46 PM, nruth wrote: > > For the time being I'm going to keep writing view specs, but try to > make them lighter and cut some of the dead wood by describing unusual > or interesting behaviour rather than all behaviour. What a strange rant. "What's the value of this? Look

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Stephen Eley
On Wed, Oct 28, 2009 at 10:47 AM, Lee Hambley wrote: > > Aalso for public record; Hanuma emailed me personally accusing me of racism, > I apologise if I offended anyone else on the list, but I feel my > observations were valid, we have similar problems on the Capistrano mailing > list with frequen

Re: [rspec-users] Rspec rollback for multiple databases

2009-10-28 Thread Stephen Eley
On Tue, Oct 27, 2009 at 12:03 PM, miv wrote: > Is there a way to user rspec with multiple databases in rails? I have > several adapters and want to seamlesly run specs on them.I think it is > appropriate to list all adapters for such feature. What sorts of problems are you having when you try?

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

2009-10-21 Thread Stephen Eley
On Wed, Oct 21, 2009 at 1:12 PM, Carl Graff wrote: > > In truth, due to my inexperience and confusion, mocks seem to slow my > development more than just creating real objects. But since there has been > so much effort to put these into testing frameworks, I think it must be > important to try and

Re: [rspec-users] Can't get running a simple rspec test: assigns is always nil

2009-10-21 Thread Stephen Eley
On Wed, Oct 21, 2009 at 1:07 PM, Alexander Seidl wrote: > > But why does this filter prevents the index action from being executed? Because returning 'false' from a filter does exactly that: it prevents the execution of the controller action. I'll bet I know what you're thinking -- you're thinki

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

2009-10-15 Thread Stephen Eley
On Thu, Oct 15, 2009 at 3:59 AM, Andrew Premdas wrote: > > You can take this further and state that no public method should ever do > anything, it should just contain calls to private methods which document how > the public method works. I expect most would consider that going to far ... > sigh O

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

2009-10-15 Thread Stephen Eley
On Wed, Oct 14, 2009 at 4:47 PM, Ashley Moran wrote: > > I don't think Scott meant to imply that private methods are bad, only that > complex ones private methods are. This is a good point. I was overgeneralizing the response, despite the question being somewhat more specific. My bad. (It's a

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

2009-10-14 Thread Stephen Eley
On Wed, Oct 14, 2009 at 3:49 PM, Scott Taylor wrote: > > Most of those options suck (esp. 1, 2, 3, & 4) - usually it represents a > design flaw (you are doing too much in your class). I disagree that the simple existence of private methods is a sign of a design flaw. There are plenty of use case

Re: [rspec-users] should and != operator

2009-10-14 Thread Stephen Eley
On Wed, Oct 14, 2009 at 4:34 AM, Ashley Moran wrote: > On 14 Oct 2009, at 02:25, Stephen Eley wrote: > >> [...] these quirks are caught when your specs >> pass and you haven't done anything to make them pass yet.  >8-> > > Really?  I just tried `1.should !

Re: [rspec-users] should and != operator

2009-10-13 Thread Stephen Eley
On Mon, Oct 12, 2009 at 5:03 PM, Ashley Moran wrote: > > This is a common mistake, and one I made for a long while even after being > familiar with RSpec.  I wonder if there is justification for an AST pass > over spec files to catch this (among possibly other issues)? The AST pass over the spec

Re: [rspec-users] [ANN] rspec-rails 1.2.9 Released

2009-10-06 Thread Stephen Eley
On Tue, Oct 6, 2009 at 9:52 AM, Chris Flipse wrote: > rubyforge seems to have picked up the rspec release, but not the rspec-rails > release -- the web interface (at least) still says that the most recent > rspec-rails is 1.2.7.1 The gems repository is right, though. Running "gem outdated" tells

Re: [rspec-users] Can't run specs after upgrading gems... get 0 tests, 0 assertions...

2009-10-04 Thread Stephen Eley
On Sun, Oct 4, 2009 at 4:15 PM, Paco Guzman wrote: > > If I change to :lib => false I got the same text in the execution. But > If I uninstall test-unit 2.0.3 like Len said the examples executes > right. There's a pernicious known bug in RSpec that causes it to fail with newer versions of the tes

Re: [rspec-users] factory girl rspec and authlogic

2009-10-03 Thread Stephen Eley
On Sat, Oct 3, 2009 at 8:41 PM, Don French wrote: > I am trying some simple test using the above items. Using the > Factory.create(...) gives Active Record errors and not the failure of > the test. Change it to u = Factory.build(...) then u.save, I do not > get the Active record error but the prop

Re: [rspec-users] Is there a good (non-judgemental) comparison of Rspec mocking vs Mocha?

2009-10-03 Thread Stephen Eley
On Sat, Oct 3, 2009 at 8:09 PM, Rick DeNatale wrote: > > I was thinking that there must be a comparison/conversion chart > somewhere, like the Test:Unit => RSpec translation guide in the RSpec > docs, but my usually awesome google skills seem to be failing me on > this. Major differences off the

Re: [rspec-users] what's wrong with my newbie cucumber test?

2009-10-02 Thread Stephen Eley
On Fri, Oct 2, 2009 at 9:24 AM, Tim Walker wrote: > Try commenting out your step completely or temporarily removing > forums_step.rb. Run and see what step it's matching. I'd imagine it's > matching a webrat step. Also: there's a separate list for Cucumber stuff these days. Check out: http://gro

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

2009-10-01 Thread Stephen Eley
On Thu, Oct 1, 2009 at 1:45 PM, Zach Dennis wrote: > Your name has intrigued me. Do you really hate underscores? :) Some people are ReallyPassionateAboutCamelCase. -- Have Fun, Steve Eley (sfe...@gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org __

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

2009-09-26 Thread Stephen Eley
On Sat, Sep 26, 2009 at 10:28 AM, David Chelimsky wrote: > > We don't offer much help, as Matt doesn't see a problem and I can't > reproduce it - but at least we tried to play :) I'll take a turn! Helps me procrastinate on my own stuff. >8-> Giuseppe: have you tried running 'rake routes' to se

Re: [rspec-users] DRYing out controller specs?

2009-09-24 Thread Stephen Eley
On Thu, Sep 24, 2009 at 8:13 PM, Eric Hahn wrote: > > The controllers themselves are using josevalim's wonderful > inherited_resources gem, so they are incredibly small - I'm basically looking > for something like this on the rspec side... (*googling*) Aha. Looks a lot like the old make_resou

Re: [rspec-users] bmabey-fakefs Not Found Error when installing rspec 1.2.9.rc1

2009-09-23 Thread Stephen Eley
On Wed, Sep 23, 2009 at 1:16 PM, DanS wrote: > > but I still get the same error after installing bmabey-fakefs.  I > notice that "gem list" command shows this as "fakefs" and not "bmabey- > fakefs" but I don't know if this naming difference matters, or what to > do about it if it does. I'm glad y

Re: [rspec-users] rspec-rails and rack middleware

2009-09-22 Thread Stephen Eley
On Tue, Sep 22, 2009 at 8:24 AM, Aaron Gibralter wrote: > > I can get the dummy_app to work, but now I'm trying to figure out how to use > my Rails app. I'll keep playing around and see if I can come up with > anything. It sounds like you're trying to do integration testing (all the pieces of the

Re: [rspec-users] describe block proc parameter as alternative to before blocks?

2009-09-22 Thread Stephen Eley
On Tue, Sep 22, 2009 at 8:55 AM, nruth wrote: > > I guess the short answer is no, stop being silly, [...] It wasn't silly at all to raise the question. I apologize sincerely if I gave the impression that I was trying to be insulting. It's _very_ worthwhile to ask questions about The Way Things

Re: [rspec-users] describe block proc parameter as alternative to before blocks?

2009-09-21 Thread Stephen Eley
On Sun, Sep 20, 2009 at 9:34 PM, nruth wrote: > > We're using a describe (or context) block to name (or document) a > state, then using a separate before block to set up that state > (context). If that before block were to go astray the documentation > would cease to be correct. On further readin

Re: [rspec-users] describe block proc parameter as alternative to before blocks?

2009-09-21 Thread Stephen Eley
On Sun, Sep 20, 2009 at 9:34 PM, nruth wrote: > > I think I wasn't clear with my original post: before blocks work fine, > this is just a readability/comprehension/maintenance concern. Peanut gallery: I personally find the separate "before" block clearer, more readable, and more aesthetically app

Re: [rspec-users] rspec-rails and rack middleware

2009-09-21 Thread Stephen Eley
On Tue, Sep 22, 2009 at 12:22 AM, Aaron Gibralter wrote: > It doesn't seem like my controller specs are calling my middleware on > requests. Has anyone figured out a good way to test middlware with rspec? Rack::Test is your friend: http://github.com/brynary/rack-test If you Google it, there's a

Re: [rspec-users] Am I on the right track?

2009-09-21 Thread Stephen Eley
On Mon, Sep 21, 2009 at 5:48 PM, Calvin wrote: > > I am pretty new to RSpec and I wonder if some code I have written is > leading me in the right direction. Any advice is greatly appreciated! As a beginner exercise, this code looks perfectly functional to me. But I believe you left out the intere

Re: [rspec-users] Halting rake rspec

2009-09-15 Thread Stephen Eley
On Tue, Sep 15, 2009 at 3:12 PM, Anton Trapp wrote: > > Short question: How can I stop a rspec rake task without having to wait for > about 5 minutes (1 ctrl-c keypress autorepeat for every test case)? 1. ps ax | grep rake 2. (look at the process id in the lefthand column) 3. kill -9 [process id]

Re: [rspec-users] Suggestion: a more visual RSpec

2009-09-13 Thread Stephen Eley
On Fri, Sep 11, 2009 at 8:58 PM, David Whetstone wrote: > > I'm not married to this particular implementation, the result of a series of > compromises made while trying to add this ability with few changes to RSpec. >  Being able to produce the output above is really what I'm after.  In > addition

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

2009-09-02 Thread Stephen Eley
On Wed, Sep 2, 2009 at 3:34 AM, Jeremy Hageman wrote: > > But this is not possible since current_user is a method unavailable to > the specs. At this point I realize this situation is much better > served by stubbing and mocking the functions and models. Why isn't current_user available to your co

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

2009-09-01 Thread Stephen Eley
On Tue, Sep 1, 2009 at 4:11 PM, Jeremy Hageman wrote: > As someone relatively new to rspec, I am interested in hearing the > wisdom of the group in the area of using a fixture replacement gem > (such as machinist or factory girl) instead of mocking the model. For what kind of test? -- Have Fun

Re: [rspec-users] Sharing code and still keeping a "only commit if all is green" discipline

2009-08-21 Thread Stephen Eley
On Fri, Aug 21, 2009 at 4:44 PM, Rick DeNatale wrote: > > Actually, the way I read it was that management was already on board > with git and approved converting over to it which they have, but it's > the cow orkers and their lack of training which is "preventing" them > from actually benefitting f

Re: [rspec-users] Sharing code and still keeping a "only commit if all is green" discipline

2009-08-21 Thread Stephen Eley
On Fri, Aug 21, 2009 at 11:14 AM, Marcelo de Moraes Serpa wrote: > > I'm using git, actually I love git. However, we started with svn > unfortunately and only now the management saw the benefits of git and > we migrated. However, 99% of the developers of this project does not > know how to use git,

Re: [rspec-users] Sharing code and still keeping a "only commit if all is green" discipline

2009-08-20 Thread Stephen Eley
On Thu, Aug 20, 2009 at 8:00 PM, Marcelo de Moraes Serpa wrote: > > However, a co-worker of mine came to me and said that partial commits > are needed to share code. I don't agree with that, I think we can use > patches or branches to do that (like a development branch) but at > least one branch sh

Re: [rspec-users] How to mock http accept header?

2009-08-16 Thread Stephen Eley
On Sun, Aug 16, 2009 at 9:01 PM, Chamnap wrote: > I did the same thing as you did, but it doesn't work.  The respond_to > method still responses back in "application/xml". Any idea? It sounds like you're pretty sure your code is correct and your tests are broken. Does the application work outside

Re: [rspec-users] Cookies...

2009-08-14 Thread Stephen Eley
On Fri, Aug 14, 2009 at 10:35 AM, Denis Haskin wrote: > > (in application_helper_spec.rb) >     it "should return false and set the cookie to true if it is not set" do >   cookies[:fp_skip_hp_video].should == nil >   skip_hp_video.should == false >   cookies[:fp_skip_hp_video].should in

Re: [rspec-users] [rspec-rails] rspec-rails forcing test environment?

2009-08-10 Thread Stephen Eley
On Fri, Jul 31, 2009 at 4:57 AM, Balint Erdi wrote: > > One possible workaround is to put the rspec and rspec-rails lines into > the environment file for the test env. (test.rb), but that seems to > defeat the goal of having all dependencies in one place so that it is > clear and gem-related rake t

Re: [rspec-users] Rspec api ideas, inspired by Cucumber

2009-08-01 Thread Stephen Eley
On Fri, Jul 31, 2009 at 7:36 AM, David Chelimsky wrote: > > Other thoughts? Here's one I've been meaning to bring up for a while: porting Cucumber's FIT-like table functionality to RSpec. I don't use scenario outlines very much in Cucumber. I much prefer factories and keeping one clear narration

Re: [rspec-users] How should you make sure the user is not authenticated

2009-07-27 Thread Stephen Eley
On Mon, Jul 27, 2009 at 12:39 PM, Marcelo de Moraes Serpa wrote: > > So, it is not a matter of "checking the user is not authenticated", > but of "setting the ground and making sure the user is not > authenticated", which of course, means loggin out the user on this > given step to make sure it is

Re: [rspec-users] My very fist spec file (not sure what's wrong..)

2009-07-21 Thread Stephen Eley
2009/7/22 internetchris : > > So if that's the case is the main use of rspec within a rails app for > the model and validation testing? For a lot of people, yes. It's certainly a fair generalization that model specs are the easiest and most straightforward specs in Rails. If you're applying MVC w

Re: [rspec-users] [RAILS] - 2.3.3 creating a sea of red

2009-07-21 Thread Stephen Eley
2009/7/21 mpd : > > I'm sure this is due to some Rails change, but I can't find any info > about it. Only running my specs is broken, both via rake and the spec > command. I can use script/console with both test and development > environments with no problems, and the app looks to be running fine.

Re: [rspec-users] My very fist spec file (not sure what's wrong..)

2009-07-21 Thread Stephen Eley
2009/7/21 internetchris : > When writing specs for controllers am I always > going to mock the model? Are controllers always isolated from the > actual model? Hi Chris, Pretty insightful of you. This is one of those philosophical questions that tends to keep coming up. The only valid answer to

Re: [rspec-users] how to spec a recursive method that creates db records?

2009-07-21 Thread Stephen Eley
On Tue, Jul 21, 2009 at 3:18 AM, Barun Singh wrote: > I get your point, and I already understood it well before my original > email.  We all know that generic advice isn't always applicable in every > instance, however, and this is a case where the number of distinct specs > required to test all in

Re: [rspec-users] how to spec a recursive method that creates db records?

2009-07-20 Thread Stephen Eley
On Tue, Jul 21, 2009 at 2:05 AM, Barun Singh wrote: > This isn't a question of refactoring; I can > easily refactor the method as you describe but this doesn't resolve the > issue (indeed, it just leads to an increased number of public methods in the > model with no real benefit). Why would they h

Re: [rspec-users] My very fist spec file (not sure what's wrong..)

2009-07-20 Thread Stephen Eley
On Mon, Jul 20, 2009 at 11:05 PM, Chris Sund wrote: > > I am finally to the point in the rspec book where it describes how to > implement controller specs, so I thought what the heck, I'll give it a > try. Heh. Points to you for ambition! You might not have realized this (because the RSpec book

Re: [rspec-users] how to spec a recursive method that creates db records?

2009-07-20 Thread Stephen Eley
On Mon, Jul 20, 2009 at 8:33 PM, Barun Singh wrote: > > I want to find a way to write a spec for this method that does both of these > things: > (1)  stub out the do_something method (that method has its own specs) > (2)  not stub out the logic in the else statement, (there is some complex > logic

Re: [rspec-users] Should deleting code require failing specs?

2009-07-16 Thread Stephen Eley
On Wed, Jul 15, 2009 at 6:03 PM, Adam Anderson wrote: > Sometimes when features are asked to be removed it doesn't make sense to > specify that they shouldn't be there. It seems to me that removing something > from a tested app should not entail writing a failing spec for that change. > I'm curious

Re: [rspec-users] Where to put macros

2009-06-22 Thread Stephen Eley
On Mon, Jun 22, 2009 at 12:37 PM, David Chelimsky wrote: > > The convention that I see emerging is to keep macros, helpers, and any > other spec supporting material in spec/support/macros, > spec/support/matchers, etc. +1 from me too. I've been calling my directory spec/helpers, but I've been wor

Re: [rspec-users] shared examples sharing methods

2009-06-17 Thread Stephen Eley
On Thu, Jun 18, 2009 at 12:17 AM, Ben Mabey wrote: > > If you do go down that route, I recommend method calls instead of instance > variables.  That way it will yell out you when you forget to define one. :) Hey, instance variables do that too. Yelling == "my tests fail." >8-> (And if they don'

Re: [rspec-users] shared examples sharing methods

2009-06-17 Thread Stephen Eley
On Wed, Jun 17, 2009 at 11:14 AM, Andrew Premdas wrote: > What I'd like to do is create a shared_examples group which I can parametize > a method. So my shared example would perhaps use method named_address=, or > set_named_address and then groups that behave like "Named address" would be > able to

Re: [rspec-users] Spec for image upload and resizing

2009-06-15 Thread Stephen Eley
On Mon, Jun 15, 2009 at 1:25 AM, srinu<36sr...@gmail.com> wrote: > >  But every time I run the test images are saving. Is there any way to > test my asset model? Well, it does have to save the processed image *somewhere* or you're not going to have anything to measure. My suggestion would be to o

Re: [rspec-users] The problem with learning RSpec

2009-06-12 Thread Stephen Eley
Ben and Rick, Thanks very much to both of you for the encouraging responses. Your reply, Ben, came just in time as I was starting to wonder if I had made a complete and irrevocable ass of myself. On Fri, Jun 12, 2009 at 10:36 AM, Ben Mabey wrote: > In general though I don't know if I > really s

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Stephen Eley
On Thu, Jun 11, 2009 at 12:56 PM, David Chelimsky wrote: > > This may be true in some cases, but generally with validations the > controller passes the params straight through to the model without > caring about them in any way. In those cases, where the controller is > only interacting with method

[rspec-users] The problem with learning RSpec

2009-06-11 Thread Stephen Eley
So... In the recent five-hundred-and-forty-seventh iteration of the "What's the point of mocks?" discussion on this list, David Chelimsky ended a message with: > [ . . . ] Really, I think > that's what we should all be striving for. Not so much "should I use > mocks or not," but "when should I

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Stephen Eley
(NOTE: This reply is no longer really for Amit's benefit any more. What David said made perfect sense as an answer to the original question. Now I'm just spinning off into theory.) ((But David -- if the repetition of this whole argument On Thu, Jun 11, 2009 at 9:36 AM, David Chelimsky wrote: > >

Re: [rspec-users] Mock and Stub objects

2009-06-10 Thread Stephen Eley
On Wed, Jun 10, 2009 at 6:55 AM, Amit Kulkarni wrote: > >      In the book it is mention about mock and stub objects.but i am > still not getting the reason behind it. The Very Short Answer: You don't want your controller specs failing because your model is broken. Your _model_ specs should fail

Re: [rspec-users] Driving Out A View - Layouts and Sessions?

2009-06-06 Thread Stephen Eley
On Sat, Jun 6, 2009 at 1:01 AM, Lee wrote: > > When I execute this, it complains of a missing method "sub_menu". This > method, along with others such as "main_menu", are called within the > layout. Unlike "main_menu" which is defined in my > "application_helper.rb" file, "sub_menu" is defined in t

Re: [rspec-users] Driving Out A View - Am I specifying too much?

2009-06-05 Thread Stephen Eley
On Fri, Jun 5, 2009 at 4:53 PM, Charlie Bowman wrote: > I never spec my views.  I also never put conditional logic in the views.  If > you have links that should show up sometimes and not others why not just > move that logic into a helper or other associated class and test the method? Good point.

Re: [rspec-users] Driving Out A View - Layouts and Sessions?

2009-06-05 Thread Stephen Eley
On Fri, Jun 5, 2009 at 11:40 AM, Lee wrote: > > Firstly, my experiments suggest that the layout is only rendered if > the :layout attribute is included in the call to render. Is my > understanding correct? Yes, and it's the way things should be. I suggest writing a separate spec for the layout, a

Re: [rspec-users] Driving Out A View - Am I specifying too much?

2009-06-05 Thread Stephen Eley
On Fri, Jun 5, 2009 at 11:54 AM, Lee wrote: > > When specifying the view, should I include examples to specify which > links should appear against an item for each potential role of a > member? Or is this going too far? It depends. If you're doing full BDD on your view, using RSpec as a design to

Re: [rspec-users] having autospec run tests?

2009-06-03 Thread Stephen Eley
On Wed, Jun 3, 2009 at 1:01 PM, Joe Van Dyk wrote: > > I really like how: > AUTOFEATURE=true autospec > works on my projects that use rspec and cucumber. > > Can I get that same behavior, but with my tests in the tests directory? Sure. In fact it should work just fine out of the box: do the same

Re: [rspec-users] thoughts on this?

2009-05-27 Thread Stephen Eley
On Wed, May 27, 2009 at 8:19 PM, Matt Wynne wrote: > http://robertlally.com/post/bdd-not-so-much *shrug* I think he's being too literal and missing the substance of the practice by criticizing its veneer. I personally don't use BDD as a path to customer communication; in the majority of my proj

Re: [rspec-users] Sharing common Cuke steps

2009-05-09 Thread Stephen Eley
On Fri, May 8, 2009 at 10:24 AM, aslak hellesoy wrote: >> [ Matt Wynne: ] >> So are you saying we'd put the steps in a gem, then include them using >> require? > > Yes. Is there any reason not to accept them for inclusion in the Cucumber gem? You already have precedent with the Webrat steps. O

Re: [rspec-users] Current Evaluation of RSpec

2009-04-28 Thread Stephen Eley
On Tue, Apr 28, 2009 at 10:57 PM, Nicholas Van Weerdenburg wrote: > Looking around outside of the book, reading reviews of RSpec on the web > seems tricky. Most reviews seem very dated, and as a result are misleading. > Is this an accurate assessment? I don't think so. The core syntax and sensib

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly spe cing

2009-04-27 Thread Stephen Eley
On Sun, Apr 26, 2009 at 10:20 PM, Dan North wrote: > 2009/4/24 Stephen Eley >> >> Yeah, I'm a smartass. > > Well you seem to be on the right lines to me. Thank you! That means a great deal to me. -- Have Fun, Steve Eley (sfe...@gmail.com) ESCAPE POD - T

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly spe cing

2009-04-23 Thread Stephen Eley
On Thu, Apr 23, 2009 at 2:19 PM, Fernando Perez wrote: > Rails definitely entices you to break Demeter's law just so often. So fix it. It's usually just a matter of putting in some delegators. If you don't like @article.comments.build, you can declare your own Article.build_comment() method and

Re: [rspec-users] Why RSpec?

2009-04-22 Thread Stephen Eley
On Wed, Apr 22, 2009 at 7:25 AM, Amos King wrote: > I wasn't thinking about a gun.  I was just wondering if there is some > underlying reason that I'm missing.  Is there a background structure > that I'm not grasping?  Is there a huge piece of functionality that > I'm missing?  Is it faster than T

Re: [rspec-users] specs for attributes with default values on the SQL layer

2009-04-18 Thread Stephen Eley
My question is, why bother? Unless I'm missing something, testing for the existence of an error that your code will never provide sounds backwards. Instead test that you DON'T get an error when the required value isn't explicitly supplied, to confirm that the default works. (Although, really, the

Re: [rspec-users] [Cucumber] How can I pass an XML block as a parameter?

2009-04-14 Thread Stephen Eley
On Wed, Apr 15, 2009 at 1:12 AM, Aslak Hellesøy wrote: > > Allright allright. You *will* be allowed into Cucumber heaven :-) Woohoo! That makes me so happy that I won't share any of the dirty jokes that sentence evokes. >8-> -- Have Fun, Steve Eley (sfe...@gmail.com) ESCAPE POD - The S

Re: [rspec-users] [Cucumber] How can I pass an XML block as a parameter?

2009-04-14 Thread Stephen Eley
On Tue, Apr 14, 2009 at 10:37 PM, Stephen Eley wrote: > > Sorry if I'm asking dumb questions, but I was trying to look this up a > few weeks ago myself to represent some example Markdown data, and > eventually gave up.  This isn't documented anywhere that I could find. >

Re: [rspec-users] [Cucumber] How can I pass an XML block as a parameter?

2009-04-14 Thread Stephen Eley
On Tue, Apr 14, 2009 at 8:37 PM, Ben Mabey wrote: > > Have you tried the pystring syntax? > > Given I want to have multiple lines > """ > I can pass them > in with three quotes... > """ How does that parse into a step definition? Would it be: Given /^I want to have multiple lines\n(.*)$/m do |t

Re: [rspec-users] Spec run heuristics (Re: Cucover: coverage-aware 'lazy' cucumber runs)

2009-04-13 Thread Stephen Eley
On Mon, Apr 13, 2009 at 7:46 AM, aslak hellesoy wrote: > > So if someone develops a better AutoTest with a plugin architecture, and > that doesn't have to run as a long/lived process, then I'd be very > interested in writing the neural network part - possibly backed by FANN > (http://leenissen.dk/

Re: [rspec-users] Problem seeing and accessing RSpec gems

2009-04-13 Thread Stephen Eley
On Mon, Apr 13, 2009 at 4:46 PM, Sarah Gray wrote: > Jeff,  always a good idea -- it didn't work in this case, but I've seen it > before.  I ended up uninstalling my rails gem (and the action* gems) and > reinstalling; then, reinstalling rspec and rspec-rails.  After that, rspec > worked without t

Re: [rspec-users] Spec run heuristics (Re: Cucover: coverage-aware 'lazy' cucumber runs)

2009-04-12 Thread Stephen Eley
On Sun, Apr 12, 2009 at 6:47 PM, Steve Molitor wrote: > Regarding the exception nagger,  would a simple script that grepped the log > file for exceptions and produced a list of failing lines in your code be a > start? Hi Steve, I think so. If it said which class-or-module and method they were d

Re: [rspec-users] How to Spec a Web Services Client

2009-04-12 Thread Stephen Eley
On Sun, Apr 12, 2009 at 4:03 PM, Stephen Eley wrote: > > I just had the same challenge with a SOAP client I'm building that > hits a fairly complicated service.  My solution was to generate a > dummy SOAP server that accepts the right calls and returns the right > kinds of dum

Re: [rspec-users] How to Spec a Web Services Client

2009-04-12 Thread Stephen Eley
On Sun, Apr 12, 2009 at 3:24 PM, s.ross wrote: > I put a pastie out at http://pastie.org/24, which is an implementation > (short) of an XML-RPC client. I'm getting wrapped around an axle trying to > figure out how to spec this without actually hitting the remote server. I just had the same ch

Re: [rspec-users] Spec run heuristics (Re: Cucover: coverage-aware 'lazy' cucumber runs)

2009-04-11 Thread Stephen Eley
On Sat, Apr 11, 2009 at 2:02 PM, Ashley Moran wrote: > > I was just idly thinking, could a code-coverage based system could be > combined with some sort of failure (fragility) history to balance the time > cost of heavy feature runs with the benefits of having something run > end-to-end?  We've ha

Re: [rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-10 Thread Stephen Eley
On Fri, Apr 10, 2009 at 11:49 AM, Lenny Marks wrote: > > One place I've actually been interested in testing URLs was to verify that > the app actually redirected after a form submission. I can agree with this, and I had a similar need just the other day. I had an action that redirected to differ

Re: [rspec-users] Cucumber - Recommended viewing.

2009-04-10 Thread Stephen Eley
On Fri, Apr 10, 2009 at 8:07 PM, James Byrne wrote: > http://mwrc2009.confreaks.com/14-mar-2009-15-00-bdd-with-cucumber-ben-mabey.html Strongly agreed. I've been watching all of the Mountain West RubyConf presentations, and came close to skipping the BDD one, thinking "I've been working with thi

Re: [rspec-users] Good introduction to rspec

2009-04-01 Thread Stephen Eley
2009/4/1 Pablo L. de Miranda : > @Fernando - So what material you recommend to start a study in rSpec? 1.) The Web site documentation at http://rspec.info 2.) Use it and build experience. 3.) Get the beta of the RSpec book. 4.) Use it and build experience. 5.) Google is your friend. 6.) Use i

Re: [rspec-users] Good introduction to rspec

2009-04-01 Thread Stephen Eley
On Tue, Mar 31, 2009 at 11:50 PM, Fernando Perez wrote: > > I don't spec at all the way he shows, I might be doing things wrong, but > I am very happy with my workflow. http://www.kipling.org.uk/poems_neolithic.htm (The poem's by Rudyard Kipling, if the URL doesn't make it clear.) -- Have Fun

Re: [rspec-users] Cucumber step definitions vs. RSpec examples

2009-03-30 Thread Stephen Eley
On Mon, Mar 30, 2009 at 7:08 AM, Brandon Olivares wrote: > > For me, it's either TDD or BDD, honestly. I've experienced the assurance > having tests for nearly every line of code affords me, and don't want to > forgo that. But I like the semantics of BDD a lot better, after reading the > RSpec boo

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-29 Thread Stephen Eley
On Sat, Mar 28, 2009 at 4:49 PM, Bart Zonneveld wrote: > > I very strongly disagree on this one. As it so happens, we've found a bug in > Passenger regarding uploads, umasks and permissions, which was caused by > Passenger overwriting the TMP_DIR environment variable. Took us quite a > while to fi

Re: [rspec-users] Cucumber step definitions vs. RSpec examples

2009-03-29 Thread Stephen Eley
On Sat, Mar 28, 2009 at 9:49 AM, Brandon Olivares wrote: > > So, I'm confused. I've been trying to use Cucumber and RSpec, but step > definitions and RSpec examples just seem to be overlapping. What should go > in either one of these? This is a subjective judgment call that doesn't have an absolu

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-27 Thread Stephen Eley
On Fri, Mar 27, 2009 at 4:50 PM, Tadatoshi Takahashi wrote: > > About Steve's comment, > I may not be familiar with everything in Ruby on Rails but I am willing > to learn. FWIW, I absolutely did not mean my comment as an insult, to you or anybody else. I was going a bit more general, and wasn't

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-27 Thread Stephen Eley
On Fri, Mar 27, 2009 at 8:36 AM, David Chelimsky wrote: > > You can also change spec_helper.rb to force the test environment with: >  ENV["RAILS_ENV"] = 'test' > That's what it used to do but somebody complained that it shouldn't > force an environment :) Yeah. Running tests in the 'test' enviro

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-25 Thread Stephen Eley
On Wed, Mar 25, 2009 at 5:49 PM, Tadatoshi Takahashi wrote: > > I have never set RAILS_ENV anywhere. > To make sure, I have looked at .profile but RAILS_ENV is not set there. > > Is there any other place where that RAILS_ENV is getting set? I don't know. But the way to test it from the command l

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-25 Thread Stephen Eley
On Wed, Mar 25, 2009 at 3:29 PM, Tadatoshi Takahashi wrote: > > P.S. > It seems that autospec is run against test database and that "rake spec" > is run against development database. > How can I resolve this problem? The first thing I'd check would be whether you have RAILS_ENV defined in your .p

Re: [rspec-users] RSpec style and truthiness

2009-03-20 Thread Stephen Eley
On Thu, Mar 19, 2009 at 11:42 PM, David Chelimsky wrote: > > what_follows.should be_brilliant Thank you! Glad I could provide a bit of entertainment. (And hmmm. Now I'm wondering why Ruby culture doesn't have a phenomenon like that of Perl culture, where hackers have 'Perl Poetry' competitions

Re: [rspec-users] RSpec style and truthiness

2009-03-19 Thread Stephen Eley
2009/3/19 Rick DeNatale : > Even 'should be' is a bit grating.  I'm tempted to write a pair of matchers > like be_truthy and be_falsy, but I was wondering what other RSpec users have > to say. should be || should_not be: that is the expectation: Whether 'tis nobler in the parser to interpret The o

Re: [rspec-users] [Webrat][RSpec]

2009-03-17 Thread Stephen Eley
2009/3/17 Andrew Premdas : > Hi All, > Since upgrading rspec to 1.2 I am seeing behavior that a web browser is > being opened when there is a problem in a page that a feature visits. > Is this behavior intentional and if so can I turn it off. Having thirty > browser windows open up when I introduce

Re: [rspec-users] stubbing Time.zone.now for model tests fails for Rails 2.3.1

2009-03-11 Thread Stephen Eley
On Wed, Mar 11, 2009 at 1:40 PM, David Schmidt wrote: > > Has anyone else run into this problem and come up with a solution to getting > a fixed time back from Time.zone.now? This plugin has worked very well for me: http://github.com/notahat/time_travel/tree/master -- Have Fun, Steve Eley (

  1   2   >