[rspec-users] undefined local variable or method `params' for #Spec

2009-04-14 Thread Salil Gaikwad
following is the method of the helper module ApplicationHelper def tab_class(tab) 'class=active' if tab == params[:controller] end end i write the spec method as follows describe ApplicationHelper do it should be active if controller is same do

Re: [rspec-users] undefined local variable or method `params' for #Spec

2009-04-14 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 8:24 AM, Salil Gaikwad li...@ruby-forum.com wrote: following is the method of the helper module ApplicationHelper def tab_class(tab) 'class=active' if tab == params[:controller] end end i write the spec method as follows describe ApplicationHelper do it

Re: [rspec-users] [Cucumber] any examples of navigating cucumber parse tree from external script

2009-04-14 Thread Korny Sietsma
Good idea. It's at http://gist.github.com/95033 And as I said before, it's pretty hacky :) - Korny On Tue, Apr 14, 2009 at 3:11 PM, aslak hellesoy aslak.helle...@gmail.comwrote: On Tue, Apr 14, 2009 at 6:06 AM, Korny Sietsma ko...@sietsma.com wrote: In case anyone followed this: I got

Re: [rspec-users] (MissingSourceFile) no such file to load -- spec/expectations/differs/default

2009-04-14 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 11:00 AM, AndreXP andre.x.pretor...@gmail.comwrote: Hi All, This morning I did a gem update which installed rspec-1.2.4 and when I run my cucumber rake features command I got the following: Try the latest Cucumber code (aslakhellesoy-cucumber gem). This was fixed

Re: [rspec-users] (MissingSourceFile) no such file to load -- spec/expectations/differs/default

2009-04-14 Thread AndreXP
Fixed :) I should have looked in lighthouseapp for this ticket..!! Thanks for the speedy reply. Andre Aslak Hellesoy wrote: On Tue, Apr 14, 2009 at 11:00 AM, AndreXP andre.x.pretor...@gmail.comwrote: Hi All, This morning I did a gem update which installed rspec-1.2.4 and when I run

Re: [rspec-users] Fwd: How do you mock an object to expect A then B then A?

2009-04-14 Thread doug livesey
Could be wrong, but what about removing the stipulation that each call should be received once? Is that superfluous to requirements, there? I think so. You've already specified three calls in order, so that should cover it. 2009/4/14 Nigel Thorne nigel.tho...@gmail.com Hi Folks, I want to

Re: [rspec-users] [Cucumber] any examples of navigating cucumber parse tree from external script

2009-04-14 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 11:34 AM, Korny Sietsma ko...@sietsma.com wrote: I should clarify what might not be obvious from the code: This builds two sets of pages in the wiki: - Features, which are basically just a dump of the features files into wiki format, added as children of the main

[rspec-users] (MissingSourceFile) no such file to load -- spec/expectations/differs/default

2009-04-14 Thread AndreXP
Hi All, This morning I did a gem update which installed rspec-1.2.4 and when I run my cucumber rake features command I got the following: c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:142:in `activate': can't activate rspec (= 1.2.2, runtime), already activated rspec-1.2.4 (Gem::Exception)

Re: [rspec-users] [Cucumber] any examples of navigating cucumber parse tree from external script

2009-04-14 Thread Korny Sietsma
I should clarify what might not be obvious from the code: This builds two sets of pages in the wiki: - Features, which are basically just a dump of the features files into wiki format, added as children of the main Features page (confluence lets you have parent/child relationships, which is great

[rspec-users] various results from same test

2009-04-14 Thread Jeremiah Heller
Hi, I've read on the 'Cucumber Backgrounder' page that running cuc via rake, command line and autotest could give different results but I seem to get different results depending on the path I pass cucumber and am not sure what's going on. I would be grateful for any help or insight.

Re: [rspec-users] undefined local variable or method `params' for #Spec

2009-04-14 Thread Fernando Perez
it gives me following error undefined local variable or method `params' for That's normal. Remember that params exists because there is an http request issued. In your spec, you don't tell Rspec anything about any request. So you could create a mock for params. If I recall correctly you

[rspec-users] [Cucumber] attribute readers in World?

2009-04-14 Thread aidy lewis
Hi, #env.rb class ProjectWorld include Spec::Matchers def browser @browser ||= Browser.new end end World do ProjectWorld.new end Instead of using explicit getters here, can I not use attribute readers? Aidy ___ rspec-users

Re: [rspec-users] various results from same test

2009-04-14 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 1:32 PM, Jeremiah Heller jeremiah.hel...@gmail.comwrote: Hi, I've read on the 'Cucumber Backgrounder' page that running cuc via rake, command line and autotest could give different results but I seem to get different results depending on the path I pass cucumber and

Re: [rspec-users] undefined local variable or method `params' for #Spec

2009-04-14 Thread Salil Gaikwad
Fernando Perez wrote: it gives me following error undefined local variable or method `params' for That's normal. Remember that params exists because there is an http request issued. In your spec, you don't tell Rspec anything about any request. So you could create a mock for params. If

Re: [rspec-users] [Cucumber] attribute readers in World?

2009-04-14 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 2:19 PM, aidy lewis aidy.le...@googlemail.comwrote: Hi, #env.rb class ProjectWorld include Spec::Matchers def browser @browser ||= Browser.new end end World do ProjectWorld.new end Instead of using explicit getters here, can I not use attribute

Re: [rspec-users] undefined local variable or method `params' for #Spec

2009-04-14 Thread Fernando Perez
Try with that: controller.stub!(:params).and_return({:controller = 'your_controller_name'}) -- 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] undefined local variable or method `params' for #Spec

2009-04-14 Thread Fernando Perez
it should be active if controller is same do params = {:controller = 'royalty_statement'} tab_class('royalty_statement').should include('active') end but it doesn't work out. it gives me same error as previous. Nah it doesn't work that way, because remember that RSpec is just

Re: [rspec-users] undefined local variable or method `params' for #Spec

2009-04-14 Thread Salil Gaikwad
Try with that: controller.stub!(:params).and_return({:controller = 'your_controller_name'}) Nah it doesn't work out,gives same error. neways thanx for the info. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list

Re: [rspec-users] undefined local variable or method `params' for #Spec

2009-04-14 Thread Chris Flipse
helper.stub! the OP is testing a helper method. On Tue, Apr 14, 2009 at 9:04 AM, Fernando Perez li...@ruby-forum.comwrote: Try with that: controller.stub!(:params).and_return({:controller = 'your_controller_name'}) -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] how to write a spec for an actionmailer method

2009-04-14 Thread Salil Gaikwad
http://github.com/bmabey/email-spec/blob/cdf3eeda4d28ef8b35bbce8af9ca7c493528332d/examples/rails_root/spec/models/user_mailer_spec.rb -Ben I try following and it works. i don't know how but it pass the test gives me 100% coverage and also i receive a test email. describe ApplicationHelper

Re: [rspec-users] How to write a spec file for a helper

2009-04-14 Thread Brandt Kurowski
On Apr 13, 11:26 am, Pat Maddox pat.mad...@gmail.com wrote: If this is a module that you're using to extend the behavior of Numeric classes, just mix it in somewhere and write examples for the class that got the mixin. I prefer to test modules in isolation by mixing them into a stub in the

[rspec-users] OT: RSpec support in rails.vim

2009-04-14 Thread Brandon Olivares
Hi, The rails plugin for vim has limited RSpec support, and it mentions how to add extra commands such as speccontroller, etc, with Rcommand. Has anyone done this? I'm not very good with the syntax of .vimrc, so I don't know how to enter these. I think it said I need to use autocmd, but

[rspec-users] [Cucumber] features.txt

2009-04-14 Thread Tim Walker
Hi Guys, My nightly tests stopped working suddenly over the weekend. Not sure why yet. It's wierd because they just look like the exited without a clue mid-test. Nothing in the logs is a smoking gun. Here's my question: It seems like the contents of features.txt do not get written until the

Re: [rspec-users] [Cucumber] features.txt

2009-04-14 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 7:19 PM, Tim Walker walke...@gmail.com wrote: Hi Guys, My nightly tests stopped working suddenly over the weekend. Not sure why yet. It's wierd because they just look like the exited without a clue mid-test. Nothing in the logs is a smoking gun. Here's my question:

[rspec-users] [Cucumber] ANN: Cucumber 0.3.0

2009-04-14 Thread aslak hellesoy
The full changelog is here: http://github.com/aslakhellesoy/cucumber/blob/98eefc22f50371e8c3bd02ef8715176d6f586198/History.txt Enjoy! The Cucumber team (Aslak, Joseph, Ben) ___ rspec-users mailing list rspec-users@rubyforge.org

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

2009-04-14 Thread Andrew Premdas
One simple thing I asked about the other day was running multiple instances of autotest to do different things. Currently I'd like to run one for my specs and one for my features, but you could easily extend this idea. Creating several profiles that run at the same time, with the long running ones

Re: [rspec-users] various results from same test

2009-04-14 Thread Jeremiah Heller
On 14 Apr 2009, at 05:41, aslak hellesoy wrote: crud_admins.feature; just has a single step: Scenario: Create an admin user Given I can see the form to create an admin user crud_admins_steps.rb; just has a single step-def: Given I can see the form to $action a(n)?

Re: [rspec-users] [Cucumber] features.txt

2009-04-14 Thread Tim Walker
Sorry. This is running from cruisecontrol rb: --- Cucumber::Rake::Task.new(:cruise) do |t| t.cucumber_opts = -r features/cucumber_env --format pretty --out=#{ENV['CC_BUILD_ARTIFACTS']}/features.txt --format html --out=#{ENV['CC_BUILD_ARTIFACTS']}/features.html t.rcov = true

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

2009-04-14 Thread Wolfram Arnold
We're trying to verify XML REST API's and would like to write Cucumber specs of the following type: Scenario: Create a phrase Given I have an authenticated session for user with login steve When I send a POST to /phrases with parameters: locale=ca and post body ?xml version=1.0

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

2009-04-14 Thread Wolfram Arnold
Copy paste mistake: We did escape the quotes inside the XML stanza, result is the same. -- 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] [Cucumber] How can I pass an XML block as a parameter?

2009-04-14 Thread Ben Mabey
On Apr 14, 2009, at 5:39 PM, Wolfram Arnold wrote: We're trying to verify XML REST API's and would like to write Cucumber specs of the following type: Scenario: Create a phrase Given I have an authenticated session for user with login steve When I send a POST to /phrases with

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 b...@benmabey.com 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

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

2009-04-14 Thread Zach Dennis
On Tue, Apr 14, 2009 at 10:37 PM, Stephen Eley sfe...@gmail.com wrote: On Tue, Apr 14, 2009 at 8:37 PM, Ben Mabey b...@benmabey.com 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

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 sfe...@gmail.com 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.  I've also

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

2009-04-14 Thread Ben Mabey
Stephen Eley wrote: On Tue, Apr 14, 2009 at 10:37 PM, Stephen Eley sfe...@gmail.com 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

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

2009-04-14 Thread Aslak Hellesøy
On Tue, Apr 14, 2009 at 10:37 PM, Stephen Eley sfe...@gmail.com 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. I've

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 aslak.helle...@gmail.com 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)