[rspec-users] Netbeans and .story files

2008-03-31 Thread Ashley Moran
Hi Is anyone here using NetBeans and story runner? NB doesn't recognise .story files so I can't even do simple things like block commenting lines (and the regex replace is temperamental). I tried adding .story to the list of Ruby file extensions, but then it just hides everything in the story

Re: [rspec-users] Wrong story step running

2008-03-31 Thread Ashley Moran
On 28/03/2008, Ashley Moran [EMAIL PROTECTED] wrote: Is story runner having trouble matching stories when they are of the following pattern? A + B A + X + B A + Y + B Came across this again, it also causes problems when the steps are of the form A A + X However, I found a (slightly

Re: [rspec-users] Netbeans and .story files

2008-03-31 Thread Steve Rogers
On Mar 31, 2008, at 7:03 AM, Ashley Moran wrote: Hi Is anyone here using NetBeans and story runner? NB doesn't recognise .story files so I can't even do simple things like block commenting lines (and the regex replace is temperamental). I tried adding .story to the list of Ruby

[rspec-users] Confusing error with GivenStory

2008-03-31 Thread Glenn Ford
Hey all! I'm loving Stories so far, but I ran across a difficult error today that I felt should have resulted in a PENDING message. Here's what I got: /Users/Malohkan/Sites/blog/vendor/plugins/rspec_on_rails/lib/spec/ rails/../../../../rspec/lib/spec/story/runner/scenario_runner.rb:11:in

Re: [rspec-users] Netbeans and .story files

2008-03-31 Thread Ashley Moran
On 31/03/2008, Steve Rogers [EMAIL PROTECTED] wrote: I have a stories folder with files named blah_story.rb - and NetBeans doesn't seem any stranger with those than it usually is. Steve, Sorry, I wasn't clear. It's not the my_story.rb file that's the problem, it's the my_story.story file

[rspec-users] Anyone seen weird autotest behaviour on trunk?

2008-03-31 Thread Ashley Moran
Hi I'm running RSpec and RSpec on Rails r, and autotest frequently - but not consistently - fails on my after I change an individual model code file file. The error I get is this: /usr/local/bin/ruby -S script/spec -O spec/spec.opts spec/models/user_spec.rb

Re: [rspec-users] Confusing error with GivenStory

2008-03-31 Thread David Chelimsky
On Mon, Mar 31, 2008 at 11:16 AM, Glenn Ford [EMAIL PROTECTED] wrote: Hey all! I'm loving Stories so far, but I ran across a difficult error today that I felt should have resulted in a PENDING message. Here's what I got:

Re: [rspec-users] Confusing error with GivenStory

2008-03-31 Thread Glenn Ford
I sent a reply just a couple minutes later... to myself only :P Sorry about that. Here what was I sent: Here's a lighthouse ticket: http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/354-confusing-error-with-givenscenario By the way I just realized I typo'd GivenStory in the subject

Re: [rspec-users] Anyone seen weird autotest behaviour on trunk?

2008-03-31 Thread Ashley Moran
On 31/03/2008, Bart Zonneveld [EMAIL PROTECTED] wrote: I'm having the same problem, also with controllers. Weird part is, I mostly have it at work, running OS 10.4, but not at home, running 10.5. My environment is the same, except for the OS... gr, bartz Hi bartz What version of RSpec

[rspec-users] Can you add simple argument-baesd logic to stubs?

2008-03-31 Thread Ashley Moran
Hi Is there any way to do the following with stubs? template.should_receive(:formatted_last_login). with(duck_type(:last_login_date)). any_number_of_times. and_return { |user| last-login-#{user.id} } If I change should_receive to stub!, Ruby

Re: [rspec-users] Netbeans and .story files

2008-03-31 Thread Tim Haines
Hi Ashley, I don't think Netbeans has support for plain text stories yet - but I'm not certain (I was using it with frustration last night too). Probably better to ask in the netbeans forum? Cheers, tim. On 01/04/2008, Ashley Moran [EMAIL PROTECTED] wrote: On 31/03/2008, Steve Rogers [EMAIL

Re: [rspec-users] Netbeans and .story files

2008-03-31 Thread Ashley Moran
On 31 Mar 2008, at 19:27, Tim Haines wrote: I don't think Netbeans has support for plain text stories yet - but I'm not certain (I was using it with frustration last night too). Probably better to ask in the netbeans forum? Hi Tim I noticed it didn't have any out of the box support,

[rspec-users] Given .. and .. - And requires capitalisation

2008-03-31 Thread Tim Haines
Hi Guys, Just writing out a plain English story and was surprised to see one of my steps wasn't listed as pending. It turned out it was because I had started the line with and instead of And. Is there any reason why and shouldn't be an alias for And? Tim.

Re: [rspec-users] Given .. and .. - And requires capitalisation

2008-03-31 Thread Chuck Remes
On Mar 31, 2008, at 4:53 PM, Tim Haines wrote: Hi Guys, Just writing out a plain English story and was surprised to see one of my steps wasn't listed as pending. It turned out it was because I had started the line with and instead of And. Is there any reason why and shouldn't be an

Re: [rspec-users] Given .. and .. - And requires capitalisation

2008-03-31 Thread David Chelimsky
On Mon, Mar 31, 2008 at 6:06 PM, Chuck Remes [EMAIL PROTECTED] wrote: On Mar 31, 2008, at 4:53 PM, Tim Haines wrote: Hi Guys, Just writing out a plain English story and was surprised to see one of my steps wasn't listed as pending. It turned out it was because I had started the

Re: [rspec-users] Given .. and .. - And requires capitalisation

2008-03-31 Thread Tim Haines
Cool.I didn't know about and and Ruby. :-) thanks! On 01/04/2008, Chuck Remes [EMAIL PROTECTED] wrote: On Mar 31, 2008, at 4:53 PM, Tim Haines wrote: Hi Guys, Just writing out a plain English story and was surprised to see one of my steps wasn't listed as pending. It turned out

Re: [rspec-users] Given .. and .. - And requires capitalisation

2008-03-31 Thread Tim Haines
I don't know how the plain text stories are parsed, but would it be reasonable to expect that if they are plain text rather than ruby, then lower case 'and' could be used interchangeably? Is consistency really required here? I'm thinking I would like other people writing stories for me in the

Re: [rspec-users] Given .. and .. - And requires capitalisation

2008-03-31 Thread David Chelimsky
On Mar 31, 2008, at 6:29 PM, Tim Haines [EMAIL PROTECTED] wrote: I don't know how the plain text stories are parsed, but would it be reasonable to expect that if they are plain text rather than ruby, then lower case 'and' could be used interchangeably? Is consistency really required

[rspec-users] spec'ing models

2008-03-31 Thread Tim Haines
Hi there, A couple of complete newb questions here. Should I be spec'ing the existence of attributes on models? While reading through the docs and googling I haven't seen any example that checks if attributes exist on a model. i.e. Game.Description. Likewise, what I've seen on spec'ing

Re: [rspec-users] spec'ing models

2008-03-31 Thread Matt Berther
Hi Tim, I'm just a newb too, but as I understand it, you should only spec code you write. In the case of attributes on models, it's ActiveRecord code. You shouldnt need to test that. I have not been doing this. That said, I'd love to get the word from some people that have been doing it

Re: [rspec-users] spec'ing models

2008-03-31 Thread Tim Haines
Hey Matt, Cheers for that. Yeah - I'm not speccing methods like save, valid?, errors etc.. I am writing belongs_to though, so figure that should be specced somehow. I guess when I'm adding a description field to something, I might be writing a migration for it, but no other model code. I

Re: [rspec-users] spec'ing models

2008-03-31 Thread Anthony Broad-Crawford
I have been using the following approach. Looking forward to see if anyone else does something better to test associations ... describe Profile Associations do it should belong to ... do Profile.should_receive(:belongs_to).with(:account) load

Re: [rspec-users] spec'ing models

2008-03-31 Thread Tim Haines
And just to argue with myself a little - the spec output is a pretty nice of how a model works. Perhaps I'm thinking that something for the description should be specced so that it appears in the spec output.. Looking forward to taking this newb hat off sometime soon - I'm definitely spending

Re: [rspec-users] spec'ing models

2008-03-31 Thread Anthony Broad-Crawford
It looks like my first note didn't go through ... so I apologize if it is delayed and this is a duplicate. My colleagues and I have been testing associations like this ... it should have one account do Profile.should_receive(:has_one).with(:account) load profile.rb end We like

Re: [rspec-users] spec'ing models

2008-03-31 Thread Jonathan Linowes
for associations, among other things, i've been using http://rspec-on- rails-matchers.googlecode.com/svn/trunk/README linoj On Mar 31, 2008, at 8:33 PM, Anthony Broad-Crawford wrote: I have been using the following approach. Looking forward to see if anyone else does something better to

[rspec-users] Stub an instance method for every new instance of a class

2008-03-31 Thread Jed Hurt
Is there an easy way to stub an instance method for every new instance of a given class? I suppose I could just redefine the method, but I'm wondering if the RSpec mocking framework has this built in. ___ rspec-users mailing list