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

2009-02-27 Thread Evgeny Bogdanov
Thank you David. I decided to test rjs file separately of the controller, so I created a spec for it and put it into views folder. In rjs file the partial is called, however I would like to mock it. 1) I tried to use in spec the line: template.should_receive(:render).with(:partial = comments/

Re: [rspec-users] Sinitra and Cucumber

2009-02-27 Thread Steve Tooky
Aslak Hellesøy wrote: Rob Holland updated the wiki yesterday: http://wiki.github.com/aslakhellesoy/cucumber/sinatra (He reports that the $0 trick described in the blog doesn't work with the latest Sinatra). Rob also has an example in his fork, which I have yet to merge into my repo:

Re: [rspec-users] Sinitra and Cucumber

2009-02-27 Thread Aslak Hellesøy
Aslak Hellesøy wrote: Rob Holland updated the wiki yesterday: http://wiki.github.com/aslakhellesoy/cucumber/sinatra (He reports that the $0 trick described in the blog doesn't work with the latest Sinatra). Rob also has an example in his fork, which I have yet to merge into my repo:

[rspec-users] Cucumber status

2009-02-27 Thread aslak hellesoy
Just a quick heads up on Cucumber 0.2. It's taking a little longer than I had thought. Getting the Background feature working while preserving a simple AST and visitor traversal, tag filtering etc opened up a little can of worms. I've been working on this over the past weeks, and I'm getting

Re: [rspec-users] Cucumber status

2009-02-27 Thread Matt Wynne
On 27 Feb 2009, at 15:46, aslak hellesoy wrote: Just a quick heads up on Cucumber 0.2. It's taking a little longer than I had thought. Getting the Background feature working while preserving a simple AST and visitor traversal, tag filtering etc opened up a little can of worms. I've been

[rspec-users] (no subject)

2009-02-27 Thread Marcus Roberts
Apologies as this feels like an FAQ, but the only answer I can find refers to a bug in a much earlier version of rspec, and this feels like a common thing to do, so I suspect we're doing something stupid. The issue seems to be that if we mock a class, that mock carries between specs when

Re: [rspec-users] Cucumber status

2009-02-27 Thread David Chelimsky
On Fri, Feb 27, 2009 at 10:24 AM, Matt Wynne m...@mattwynne.net wrote: On 27 Feb 2009, at 15:46, aslak hellesoy wrote: Just a quick heads up on Cucumber 0.2. It's taking a little longer than I had thought. Getting the Background feature working while preserving a simple AST and visitor

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-27 Thread Matt Wynne
On 26 Feb 2009, at 18:27, Scott Taylor wrote: On Feb 26, 2009, at 1:19 PM, Forrest Chang wrote: Hi all: Is it possible to run Rails Cucumber spec in a different DB than the test DB? I'd like to run the rspec and cucumber tests in parallel in my cc.rb build, and as it is now, I get

Re: [rspec-users] (no subject)

2009-02-27 Thread David Chelimsky
On Fri, Feb 27, 2009 at 10:14 AM, Marcus Roberts m.robe...@nittygritty.net wrote: Apologies as this feels like an FAQ, but the only answer I can find refers to a bug in a much earlier version of rspec, and this feels like a common thing to do, so I suspect we're doing something stupid. The

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-27 Thread Scott Taylor
On Feb 27, 2009, at 11:41 AM, Matt Wynne wrote: On 26 Feb 2009, at 18:27, Scott Taylor wrote: On Feb 26, 2009, at 1:19 PM, Forrest Chang wrote: Hi all: Is it possible to run Rails Cucumber spec in a different DB than the test DB? I'd like to run the rspec and cucumber tests in

Re: [rspec-users] A silent cucumber?

2009-02-27 Thread Matt Wynne
On 26 Feb 2009, at 18:57, James Byrne wrote: Is there a way to only display the step detail for feature scenarios that contain failing or pending steps? I think you'll have to write your own formatter. It's pretty easy - take a look at the examples in lib/cucumber/ formatter for some

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-27 Thread Matt Wynne
On 27 Feb 2009, at 16:54, Scott Taylor wrote: On Feb 27, 2009, at 11:41 AM, Matt Wynne wrote: On 26 Feb 2009, at 18:27, Scott Taylor wrote: On Feb 26, 2009, at 1:19 PM, Forrest Chang wrote: Hi all: Is it possible to run Rails Cucumber spec in a different DB than the test DB? I'd

Re: [rspec-users] (no subject)

2009-02-27 Thread Pat Maddox
On Fri, Feb 27, 2009 at 8:14 AM, Marcus Roberts m.robe...@nittygritty.net wrote: Apologies as this feels like an FAQ, but the only answer I can find refers to a bug in a much earlier version of rspec, and this feels like a common thing to do, so I suspect we're doing something stupid. The

Re: [rspec-users] (no subject)

2009-02-27 Thread Matt Wynne
On 27 Feb 2009, at 16:14, Marcus Roberts wrote: Apologies as this feels like an FAQ, but the only answer I can find refers to a bug in a much earlier version of rspec, and this feels like a common thing to do, so I suspect we're doing something stupid. The issue seems to be that if we

Re: [rspec-users] Class mocking

2009-02-27 Thread Marcus Roberts
Unless RSpec is doing some magic under the hood that I'm not aware of, this is expected behavior - you're reassigning the constant value of MachineInstance. What you really want to do is mock/stub directly on MacineInstance. e.g. MachineInstance.should_receive(:create).and_return

Re: [rspec-users] (no subject)

2009-02-27 Thread Matt Wynne
bloody mailing list lag - three of us answered the same question! On 27 Feb 2009, at 16:46, Matt Wynne wrote: On 27 Feb 2009, at 16:14, Marcus Roberts wrote: Apologies as this feels like an FAQ, but the only answer I can find refers to a bug in a much earlier version of rspec, and this

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-27 Thread Scott Taylor
On Feb 27, 2009, at 12:01 PM, Matt Wynne wrote: On 27 Feb 2009, at 16:54, Scott Taylor wrote: On Feb 27, 2009, at 11:41 AM, Matt Wynne wrote: On 26 Feb 2009, at 18:27, Scott Taylor wrote: On Feb 26, 2009, at 1:19 PM, Forrest Chang wrote: Hi all: Is it possible to run Rails

Re: [rspec-users] Mocking classes

2009-02-27 Thread Marcus Roberts
This is not an rspec bug :) I thought not :-) This is assigning the value mock(MachineInstance) to the constant MachineInstance, which an interesting way to approach stubbing a class, but not really the idea. Can you show us the spec this is in so we can make appropriate recommendations? We

Re: [rspec-users] Class mocking

2009-02-27 Thread Matt Wynne
On 27 Feb 2009, at 17:08, Marcus Roberts wrote: Unless RSpec is doing some magic under the hood that I'm not aware of, this is expected behavior - you're reassigning the constant value of MachineInstance. What you really want to do is mock/stub directly on MacineInstance. e.g.

Re: [rspec-users] Class mocking

2009-02-27 Thread Marcus Roberts
That's the way Ruby behaves, yes. Once you assign the constant MachineInstance to point to your mock, Rails' magic auto-file-loading which normally happens when Ruby fires a 'missing constant error' will never run, so your real class will never get loaded. Assigning constants in your

Re: [rspec-users] Class mocking

2009-02-27 Thread Pat Maddox
On Fri, Feb 27, 2009 at 9:08 AM, Marcus Roberts m.robe...@nittygritty.net wrote: Unless RSpec is doing some magic under the hood that I'm not aware of, this is expected behavior - you're reassigning the constant value of MachineInstance. What you really want to do is mock/stub directly on

Re: [rspec-users] Class mocking

2009-02-27 Thread Pat Maddox
On Fri, Feb 27, 2009 at 9:36 AM, Marcus Roberts m.robe...@nittygritty.net wrote: I'm going to assume that we're doing the wrong thing by assigning a constant, which changes my question to how do we mock/stub the behaviour of our classes without that behaviour passing from spec to spec when

Re: [rspec-users] Class mocking

2009-02-27 Thread Marcus Roberts
No, because RSpec keeps track of partial mocks (mocks/stubs on real objects) and clears them out at the end of the example run. Thank you! This is the key, along with understanding we can just mock/stub onto the real object, without needing to make the object a mock object. As soon as we just

Re: [rspec-users] A silent cucumber?

2009-02-27 Thread James Byrne
Matt Wynne wrote: I think you'll have to write your own formatter. Actually, after looking at the code I discover that the existing progress formatter does just about what I was looking for. Thanks for the pointer. -- Posted via http://www.ruby-forum.com/.

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

2009-02-27 Thread Zach Dennis
Hi Evgeny, I would like to encourage you to verify your expectations that the JS is functioning in the browser, using tools like Webrat and Selenium. IMO spec'ing RJS files provides little value in the grand scheme of things, yet those specs build up a heavy maintenance overhead. With RJS you

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-27 Thread Forrest Chang
Hi Matt: Yeah, and certain rake tasks won't work, if I recall properly. RAILS_ENV=another_env rake db:test:prepare still reset the test database, not the db in another_env. Scott Indeed. I do have a fully-functioning rake db:features:prepare task which I can share if anyone's

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-27 Thread Forrest Chang
- Original Message Date: Fri, 27 Feb 2009 16:41:53 + From: Matt Wynne Please let me know how you get on running them in parallel for CI, as I'd also like to do this. At the moment we just use the two environments for faster feedback when we're regressions testing

Re: [rspec-users] Cucumber and selenium grid

2009-02-27 Thread Mike Gaffney
You can configure webrat to use selenium grid. Running tests in parallel would take having seperate test tasks or breaking them down somehow. Also the tests need to be touching atomic data or they will interfere. Guilherme Machado Cirne wrote: Hi, Does anybody know how to integrate cucumber