Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
my gem list is actionmailer (2.1.1, 1.3.3) actionpack (2.1.1, 1.13.3) actionwebservice (1.2.3) activerecord (2.1.1, 1.15.3) activeresource (2.1.1) activesupport (2.1.1, 1.4.2) fxri (0.3.6) fxruby (1.6.12) hoe (1.7.0) hpricot (0.6) log4r (1.0.5) rails (1.2.3) rake (0.8.3) rspec (1.1.8, 0.5.15) rs

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
Luis Lavena wrote: > On Fri, Oct 10, 2008 at 3:56 AM, Mano ah <[EMAIL PROTECTED]> wrote: >> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:28:in `ge >> >> describe SandboxController,"handling someaction" do >> >>@value = somemethod >> >> end >> >> end >> >> Please help me to solve t

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Luis Lavena
On Fri, Oct 10, 2008 at 3:56 AM, Mano ah <[EMAIL PROTECTED]> wrote: > > > When i run a spec file i am getting the following error > > D:\Diwakar\spec_diwa\spec\controllers>spec sandbox_controller_spec.rb > c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.5.15/lib/spec/api/sugar.rb:17:in > `method_ > missing

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
Scott Taylor wrote: > On Oct 11, 2008, at 12:42 AM, Mano ah wrote: > >> 2.1.1 > Why don't you post your spec? It would be a lot easier to help if we > could look at the same thing you were looking at. > > Scott sorry spec? -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Scott Taylor
On Oct 11, 2008, at 12:42 AM, Mano ah wrote: rails 2.1.1 and rspec 1.1.8 never worked out for me So i downgraded rails to 1.2.3. while execiting ruby /script/generate rspec_controller MyController it ask rails version 2.1.1. i was getting the describe method error as mention earlier in usi

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
rails 2.1.1 and rspec 1.1.8 never worked out for me So i downgraded rails to 1.2.3. while execiting ruby /script/generate rspec_controller MyController it ask rails version 2.1.1. i was getting the describe method error as mention earlier in using 2.1.1 -- Posted via http://www.ruby-forum.

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Scott Taylor
On Oct 10, 2008, at 11:50 PM, Mano ah wrote: How to solve the below error 1) NoMethodError in 'LoginController index should get successfully' You have a nil object when you didn't expect it! The error occurred while evaluating nil.status ./login_controller_spec.rb:9: 2) NoMethodError in 'Logi

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Scott Taylor
On Oct 10, 2008, at 11:50 PM, Mano ah wrote: How to solve the below error 1) NoMethodError in 'LoginController index should get successfully' You have a nil object when you didn't expect it! The error occurred while evaluating nil.status ./login_controller_spec.rb:9: 2) NoMethodError in 'Logi

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
How to solve the below error 1) NoMethodError in 'LoginController index should get successfully' You have a nil object when you didn't expect it! The error occurred while evaluating nil.status ./login_controller_spec.rb:9: 2) NoMethodError in 'LoginController index should render 202 file' undefin

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
Dear Scott, I am new to rspec and i am confused to test using it. Can you please help me with an easy example or link to get clear about it Regards M -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.o

Re: [rspec-users] private methode

2008-10-10 Thread Matt Wynne
On 10 Oct 2008, at 21:18, Anita Anita wrote: but I can't make it public. Why not? Who are you afraid is going to call it that shouldn't? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] private methode

2008-10-10 Thread Anita Anita
Well, it's a methods for buying with credit card info and everything. So I wanted to test it to make sure that all my code works but I can't make it public. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.

Re: [rspec-users] private methode

2008-10-10 Thread Pat Maddox
Anita Anita <[EMAIL PROTECTED]> writes: > Hi, > > Can I test private methods directly? > Or should I pass by the methods that are calling these private methods? > Or can I make the method private after testing? > What is the best way? > > Thank you The party line is not to test private methods.

Re: [rspec-users] private methode

2008-10-10 Thread Yi Wen
IMHO, one should never directly test a private method. So I prefer the second way you mentioned in your email. Better yet, think of why you want to test a private method. Is it too complicated? If this is the case, way too often this private method should not really belong to the class it's curren

[rspec-users] private methode

2008-10-10 Thread Anita Anita
Hi, Can I test private methods directly? Or should I pass by the methods that are calling these private methods? Or can I make the method private after testing? What is the best way? Thank you -- Posted via http://www.ruby-forum.com/. ___ rspec-users m

Re: [rspec-users] Solution for autospec not working

2008-10-10 Thread Luis Lavena
On Fri, Oct 10, 2008 at 8:12 AM, Dennis Sutch <[EMAIL PROTECTED]> wrote: > My setup is similar, except I'm developing a Ruby script as opposed to a > Rails applications, thus no script/about output: > C:\Users\Dennis>ruby -v > ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] > C:\Users\Dennis>

Re: [rspec-users] Mocking Kernel.system or Kernel.` for external application calls

2008-10-10 Thread Joey Geiger
Thank you, it's now working as expected. I was basing the code on what I had seen before, with examples of people stubbing Kernel.system, so I wasn't thinking about just using the object itself. ___ rspec-users mailing list rspec-users@rubyforge.org http

Re: [rspec-users] Mocking Kernel.system or Kernel.` for external application calls

2008-10-10 Thread Pat Maddox
"Joey Geiger" <[EMAIL PROTECTED]> writes: > I'm running into an issue while trying to test the execution of some > external applications called from inside my models. > > class OmssaPacker > def self.run_omssa_aws2ez2_unix(parameters) > system("perl /pipeline/vipdac/lib/omssa_aws2ez2_unix.pl

Re: [rspec-users] Mocking Kernel.system or Kernel.` for external application calls

2008-10-10 Thread Pat Maddox
> Kernel.should_receive(:system).with(/omssa_aws2ez2_unix\.pl/).and_return(true) > is what you're looking for. erm, that's a tad embarrasing :) I copy/pasted your line without editing it! It should be: OmssaPacker.should_receive(:system).with(/omssa_aws2ez2_unix\.pl/).and_return(true) Pat _

Re: [rspec-users] Need help using URL helpers in controller tests

2008-10-10 Thread David Chelimsky
On Fri, Oct 10, 2008 at 9:37 AM, Christopher Bailey <[EMAIL PROTECTED]> wrote: > I've moved on from this with a bit different approach. But, I also found > that the "get" (or whichever http method used) call expects the first > parameter to be an action, so passing in a string that is a path or UR

[rspec-users] Mocking Kernel.system or Kernel.` for external application calls

2008-10-10 Thread Joey Geiger
I'm running into an issue while trying to test the execution of some external applications called from inside my models. class OmssaPacker def self.run_omssa_aws2ez2_unix(parameters) system("perl /pipeline/vipdac/lib/omssa_aws2ez2_unix.pl #{parameters}") end end ..spec code... describe

Re: [rspec-users] fills_in NoMethodError

2008-10-10 Thread David Chelimsky
On Fri, Oct 10, 2008 at 3:05 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > Do we need to make it a bit clearer on the rspec.info site that cucumber is > the way forward? The trail of blog posts etc with the up-to-date info is > probably fairly bewildering to a newbie. I updated the website (just a q

Re: [rspec-users] Need help using URL helpers in controller tests

2008-10-10 Thread Christopher Bailey
I've moved on from this with a bit different approach. But, I also found that the "get" (or whichever http method used) call expects the first parameter to be an action, so passing in a string that is a path or URL doesn't work for that. On Fri, Oct 10, 2008 at 1:04 AM, Matt Wynne <[EMAIL PROTECT

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Scott Taylor
On Oct 10, 2008, at 2:56 AM, Mano ah wrote: When i run a spec file i am getting the following error D:\Diwakar\spec_diwa\spec\controllers>spec sandbox_controller_spec.rb c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.5.15/lib/spec/api/sugar.rb: 17:in `method_ missing': undefined method `describe

Re: [rspec-users] fills_in NoMethodError

2008-10-10 Thread Mark Thomson
Yeah, I think that would be a very good idea. Some info on how Webrat fits in with RSpec would be helpful also. FWIW, from the perspective of someone coming to this with absolutely no past Rails testing experience and only a few months of RoR experience, here's what I saw when I started lookin

Re: [rspec-users] Solution for autospec not working

2008-10-10 Thread Dennis Sutch
My setup is similar, except I'm developing a Ruby script as opposed to a Rails applications, thus no script/about output: C:\Users\Dennis>ruby -v ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] C:\Users\Dennis>spec -v rspec 1.1.8 C:\Users\Dennis>gem list ZenTest *** LOCAL GEMS *** ZenTes

Re: [rspec-users] Rspec @ UC Berkley

2008-10-10 Thread aslak hellesoy
On Fri, Oct 10, 2008 at 10:51 AM, Dan North <[EMAIL PROTECTED]> wrote: > That's actually a pretty awesome endorsement. We should put something on the > website: Who is using rspec? > Good idea! Thanks for doing that, Dan :-) Aslak > > 2008/10/9 Pat Maddox <[EMAIL PROTECTED]> >> >> Scott Taylor <

Re: [rspec-users] What's the best way to test inherited behavior?

2008-10-10 Thread Dan North
Another approach would be to prefer composition over inheritance, and either inject the server in a constructor (with a suitable name for the class) or mix it in as a module. Then you could describe the common server behavio

Re: [rspec-users] Rspec @ UC Berkley

2008-10-10 Thread Dan North
That's actually a pretty awesome endorsement. We should put something on the website: Who is using rspec? 2008/10/9 Pat Maddox <[EMAIL PROTECTED]> > Scott Taylor <[EMAIL PROTECTED]> writes: > > > I find it sort of interesting that they are using RSpec in one of the > > courses @ UC Berkley: > >

Re: [rspec-users] Cucumber / Webrat clicks_button problem

2008-10-10 Thread Mikel Lindsaar
Never mind, fixed in trunk of Webrat. On Fri, Oct 10, 2008 at 5:07 AM, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > Before I dive into the code and fix it, has anyone else worked around > / found the solution to calling 'clicks_button' when the button is > actually a button and not an input? > > ie

Re: [rspec-users] fills_in NoMethodError

2008-10-10 Thread Matt Wynne
Do we need to make it a bit clearer on the rspec.info site that cucumber is the way forward? The trail of blog posts etc with the up- to-date info is probably fairly bewildering to a newbie. On 9 Oct 2008, at 19:38, Mark Thomson wrote: Thanks guys. I took your advice and moved to cucumber. It

Re: [rspec-users] Need help using URL helpers in controller tests

2008-10-10 Thread Matt Wynne
On 9 Oct 2008, at 20:24, Christopher Bailey wrote: I have a controller test, where I want to do a GET on a page. Our URL's are complex, and need to be correct (duh, but we allow some slop, but that causes a redirect which I want to avoid). Anyway, in my controller test I do a get to the

Re: [rspec-users] What's the best way to test inherited behavior?

2008-10-10 Thread Matt Wynne
On 9 Oct 2008, at 20:35, Hongli Lai wrote: Pat Maddox wrote: I've written [1] about using shared example groups to do this sort of things. You're already using them :) but maybe you can still get something out of that post. What specifically don't you like about this solution? What Matt pro

Re: [rspec-users] cucumber and fixtures

2008-10-10 Thread Mark Thomson
Hilarious. This is exactly what I needed today as well and eventually found this thread through Google, not realizing it was already sitting in my inbox. :-). In my case I wanted to use fixtures in testing because the development db had already been populated by a data migration, and I didn't