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

2009-10-28 Thread Ben Mabey
nruth wrote: Hi Guys I'm going to put the cat amongst the pigeons here in the hope of some clarity falling out of the sky on me. My question is this: In a world with Cucumber what is the value of view specs? In the community (railscamp, for example) there are a fair number of people using Cucum

[rspec-users] HOWTO: Background tasks during test (ugly)

2009-10-28 Thread Student
I am writing a script that reads connection information from a config file, and based, on what it finds, connects to multiple mysql servers and performs tasks. To test this script, I need to set up test servers, but getting them running without causing the tests to be rerun when they stop is a bit

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] have_same_elements_of proposal

2009-10-28 Thread Rodrigo Rosenfeld Rosas
Excelent, Pat. Is this operator documented somewhere? Thank you, Rodrigo. Em 29-10-2009 00:16, Pat Maddox escreveu: Already in. [1,2].should =~ [2,1] Pat On Wed, Oct 28, 2009 at 4:44 PM, Rodrigo Rosenfeld Rosas wrote: How about having this matcher along the default available matcher

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

2009-10-28 Thread nruth
Hi Guys I'm going to put the cat amongst the pigeons here in the hope of some clarity falling out of the sky on me. My question is this: In a world with Cucumber what is the value of view specs? In the community (railscamp, for example) there are a fair number of people using Cucumber and skippin

Re: [rspec-users] have_same_elements_of proposal

2009-10-28 Thread Pat Maddox
Already in. [1,2].should =~ [2,1] Pat On Wed, Oct 28, 2009 at 4:44 PM, Rodrigo Rosenfeld Rosas wrote: > How about having this matcher along the default available matchers? > > require 'set' > Spec::Matchers.define :have_same_elements_of do |expected| >  match do |actual| >    expected.to_set ==

[rspec-users] have_same_elements_of proposal

2009-10-28 Thread Rodrigo Rosenfeld Rosas
How about having this matcher along the default available matchers? require 'set' Spec::Matchers.define :have_same_elements_of do |expected| match do |actual| expected.to_set == actual.to_set end end Example: [1,2].should have_same_elements_of([2,1]) Best Regards, Rodrigo. __

Re: [rspec-users] spec_server errors when reloading fixture replacement pl

2009-10-28 Thread Lenart Rudel
Some plugins (like Thinking Sphinx) preload all the files in the app/ folder. You can see if this is the case by logging spork's output to a file and see what requested the app/* files to load. spork -d > spork.log More details can be found here: http://upstream-berlin.com/2009/07/27/kickstart-

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

2009-10-28 Thread David Chelimsky
Sorry about that :( And thanks, Ashley, for righting (and writing) my wrong. Cheers, David On Oct 28, 2009, at 4:06 PM, Student wrote: Sweet! Thanks! On Oct 28, 3:52 pm, Ashley Moran wrote: On 28 Oct 2009, at 20:42, Student wrote: So now I'm back to the "undefined method `after' for ma

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

2009-10-28 Thread Student
Sweet! Thanks! On Oct 28, 3:52 pm, Ashley Moran wrote: > On 28 Oct 2009, at 20:42, Student wrote: > > > So now I'm > > back to the "undefined method `after' for main:Object (NoMethodError)" > > problem. > > I think it was just a typo on David's part.  Does the following work? > >    Spec::Runner

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

2009-10-28 Thread Ashley Moran
On 28 Oct 2009, at 20:42, Student wrote: So now I'm back to the "undefined method `after' for main:Object (NoMethodError)" problem. I think it was just a typo on David's part. Does the following work? Spec::Runner.configure do |config| config.after(:suite) do # shut stuff down h

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

2009-10-28 Thread Student
Well, I've got it half solved. In the shell call, I background & nohup the mysqld_safe call. After the fork, I do a Process.kill(9, pid) on each of them. That stops the "run twice" problem. So now I'm back to the "undefined method `after' for main:Object (NoMethodError)" problem. On Oct 28,

Re: [rspec-users] @request not available in before(:all) but is available in before(:each) in RSpec-Rails

2009-10-28 Thread Brian Cardarella
Thanks again Dave. I'm slowly learning the world of Rspec :) On Oct 28, 3:43 pm, David Chelimsky wrote: > On Oct 28, 2009, at 2:05 PM, Brian Cardarella wrote: > > > More playing with RSpec-Rails. > > > I've noticed that I do not have access to the @request object in   > > before > > (:all) but do

Re: [rspec-users] @request not available in before(:all) but is available in before(:each) in RSpec-Rails

2009-10-28 Thread David Chelimsky
On Oct 28, 2009, at 2:05 PM, Brian Cardarella wrote: More playing with RSpec-Rails. I've noticed that I do not have access to the @request object in before (:all) but do in before(:each) Is this expected behavior? Yes. In general, before(:all) is intended for setting global state and sh

[rspec-users] @request not available in before(:all) but is available in before(:each) in RSpec-Rails

2009-10-28 Thread Brian Cardarella
More playing with RSpec-Rails. I've noticed that I do not have access to the @request object in before (:all) but do in before(:each) Is this expected behavior? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Lee Hambley
David, great quick response, thanks - lets hope our action condenses the nonsense round here. -- Lee Hambley ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread David Chelimsky
On Oct 28, 2009, at 1:13 PM, Lee Hambley wrote: Matt, Thats a good start, can I suggest adding it to the google group homepage, whoever has admin control? That would be me. Done. Anyone is free to update the http://wiki.github.com/dchelimsky/rspec/get-in-touch wiki page. Cheers, David

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Lee Hambley
Matt, Thats a good start, can I suggest adding it to the google group homepage, whoever has admin control? -- Lee Hambley Sent from my iPhone. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

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

2009-10-28 Thread Student
Some trouble with the list here... Hmmm... That yields "undefined method `after' for main:Object (NoMethodError)" ... BUT I'm pretty sure I'm barking up the wrong tree. I think that I'm getting hung up with mysqld_safe. I'm running two test servers, which need to be in separate threads. So I

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

2009-10-28 Thread Student
Looking over things, the problem is probably with fork/exec related. I need to start mysql (two of them). They need to run in separate processes. However, I don't seem to be able to "really" exit when I call exit!. It's the final termination of these processes which trigger the reruns. I've tr

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

2009-10-28 Thread Student
Hmmm... That yields "undefined method `after' for main:Object (NoMethodError)" ... BUT I'm pretty sure I'm barking up the wrong tree. I think that I'm getting hung up with mysqld_safe. I'm On Oct 28, 10:49 am, David Chelimsky wrote: > On Oct 28, 2009, at 10:41 AM, Student wrote: > > > I need

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Matt Wynne
I did have a crack at writing some 'ground rules' a while back after we had quite a bit of chump-traffic: http://wiki.github.com/dchelimsky/rspec/get-in-touch It would be good to have a single URL we can reply with when people send these kind of feckless requests. Maybe the problem with that

Re: [rspec-users] Troble running controller spec

2009-10-28 Thread David Chelimsky
On Wed, Oct 28, 2009 at 8:40 AM, Amit Kulkarni wrote: > Hello, > Any updates on the above topic Please be sure to quote enough of the previous topic so those of us reading on phones can respond to you. There is a thread about this on the Cucumber list - please see if this information helps

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

2009-10-28 Thread David Chelimsky
On Oct 28, 2009, at 10:41 AM, Student wrote: I need to perform some work (shutdown mysql servers & delete their data directories) at the end of my tests. Naturally, I would like to use at_exit. HOWEVER, when I do, the spec file gets loaded twice (and the tests are run twice). Help? For bett

[rspec-users] at_exit in spec file?

2009-10-28 Thread Student
I need to perform some work (shutdown mysql servers & delete their data directories) at the end of my tests. Naturally, I would like to use at_exit. HOWEVER, when I do, the spec file gets loaded twice (and the tests are run twice). Help? ___ rspec-user

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Lenny Marks
I loved that 'Let me google that for you' thing that I remember Dave replying with once. http://lmgtfy.com/?q=rspec+tutorial -lenny On Oct 28, 2009, at 10:35 AM, Vishu Ramanathan wrote: Lee's frustration is not groundless. In my few weeks on this list, I have noticed a lot of requests for

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 Tutorial

2009-10-28 Thread Lee Hambley
I completely agree with your idea, also the group homepage should have a few ground rules perhaps, we have something similar on the Capistrano group. http://groups.google.co.uk/group/capistrano/ Its a real shame Google groups doesn't have better "first time poster" rules, for such things. Aalso f

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Vishu Ramanathan
Lee's frustration is not groundless. In my few weeks on this list, I have noticed a lot of requests for basic information that could easily be found with a simple search. It seems to me that complaining about it here is not going to help, though, because future offenders are not reading yet. Perh

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] Troble running controller spec

2009-10-28 Thread Amit Kulkarni
Hello, Any updates on the above topic -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Rspec - In views

2009-10-28 Thread Andrew Premdas
2009/10/28 Rails ROR > Hi All, > > I want to test my application with rspec. > > In order to test my views, I have written few specs as given in the > examples. > > Is there any way to test the user acceptance? > > i.e suppose the field takes a string. > > I want to test it for integers, float va

Re: [rspec-users] RSpec-Rails not tearing down the session?

2009-10-28 Thread Brian Cardarella
So the problem I was having was because I had a before_filter that was disabling the magic states for a specific action. I resolved the problem by changing this to an around filter: before: def disable_magic_states UserSession.disable_magic_states = true end after: def temporarily_disable_ma

[rspec-users] Rspec - In views

2009-10-28 Thread Rails ROR
Hi All, I want to test my application with rspec. In order to test my views, I have written few specs as given in the examples. Is there any way to test the user acceptance? i.e suppose the field takes a string. I want to test it for integers, float values, alphanumeric values, etc and run tes

Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread ROR
Mr. Hambley, I am sorry to say this that I didn't post regarding Rspec examples just for fun. I was really new to that and I thought that some one would guide me with more examples, better examples. But, it is really bad on your part to comment that people from India post without "searching" an

[rspec-users] Rspec rollback for multiple databases

2009-10-28 Thread miv
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. ___ rspec-users mailing list rspec-users@rubyforge.org http://r

Re: [rspec-users] How Can I inveke a code example in another one

2009-10-28 Thread David Chelimsky
On Oct 28, 2009, at 2:56 AM, zhjie685 wrote: Hi, I'm new to rspec. How could I transform the Unit:Tests code like def test_logout login get :logout assert_not_logged_in end def assert_not_logged_in assert_block { session["user"].nil? } end that a test method invoke anoth

Re: [rspec-users] Writing controller spec

2009-10-28 Thread Amit Kulkarni
Carlos Souza wrote: > Amit, > > Your controller spec that you said was working was not actually testing > your > controller since you were not calling any of your controller methods. Ok.In that case can you suggest how to call controller methods from the uppermost code which is running fine an

Re: [rspec-users] Testing url_for

2009-10-28 Thread Rodrigo Rosenfeld Rosas
Em 28-10-2009 00:21, David Chelimsky escreveu: ... Actually, I've taken a look at Factory Girl, but prefered Machinist, which is awesome. I'll take a look at Fixjour and Fixture Replacement. Do they have a blueprint-like feature? I have no problem in creating methods in ActiveRecord::Base.

[rspec-users] How Can I inveke a code example in another one

2009-10-28 Thread zhjie685
Hi, I'm new to rspec. How could I transform the Unit:Tests code like def test_logout login get :logout assert_not_logged_in end def assert_not_logged_in assert_block { session["user"].nil? } end that a test method invoke another test method,to repec code. Should I put th