Re: [rspec-users] How to write a feature that calls for a prompt?

2009-04-14 Thread Colfer, Brian
Phlip, Ah, but I am not unit testing ... I am writing an acceptance test. I am QA, not the developer and using cucumber to automate the functional and acceptance tests. Brian -Original Message- From: rspec-users-boun...@rubyforge.org [mailto:rspec-users-boun...@rubyforge.org] On Beha

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

2009-04-14 Thread doug livesey
> I'm not sure what the next step is in contributing a patch back. Me either, but I salute your go-to attitude & community-mindedness! 2009/4/15 Nigel Thorne > In my case I need to specify this behaviour. (I'm making sure the logging > happens in the right order). > > I believe it really is a bu

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 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) ESCAPE POD - The S

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 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 never heard

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 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] How to write a feature that calls for a prompt?

2009-04-14 Thread Phlip
Colfer, Brian wrote: I am writing a feature that will test an LDAP protected site. I need to login as my self with my real password. When unit testing, thou shalt not hit the wire. Mock anything that goes further than your database. Put another way, you are not going to refactor LDAP itself

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 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 never heard of

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 wrote: > On Tue, Apr 14, 2009 at 8:37 PM, Ben Mabey 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?

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 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 do |t

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

2009-04-14 Thread Ben Mabey
On Apr 14, 2009, at 1:41 PM, Tim Walker wrote: 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_ARTIFACT

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 paramete

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

[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 "

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

2009-04-14 Thread Nigel Thorne
In my case I need to specify this behaviour. (I'm making sure the logging happens in the right order). I believe it really is a bug, so I have forked rspec (on github), written a failing test and fixed my version of rspec to handle this case. My version now matches against unsatisfied expectation

[rspec-users] How to write a feature that calls for a prompt?

2009-04-14 Thread Colfer, Brian
I am writing a feature that will test an LDAP protected site. I need to login as my self with my real password. I'm thinking of writing a feature that looks something like this Feature: Login As a LDAP user I want to login And see the welcome banner So that I ca

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 t.rcov_

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)? $control

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

[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 http://rubyforge.org/mail

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

2009-04-14 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 7:19 PM, Tim Walker 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: It seems lik

[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 tests

[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 everythin

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 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 spec, in order to mak

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 ApplicationHelpe

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

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 wrote: > Try with that: > > controller.stub!(:params).and_return({:controller => > 'your_controller_name'}) > -- > Posted via http://www.ruby-forum.com/. >

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

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 rspec-user

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

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

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

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] [Cucumber] attribute readers in World?

2009-04-14 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 2:19 PM, aidy lewis wrote: > 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? > You

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

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 pa

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 wrote: > 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 g

[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 mai

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

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] 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. The

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 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 "Features" page (

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 > wrote: > >> >> Hi All, >> >> This morning I did a "gem update" which installed "rspec-1.2.4" and when >> I >> run my cucu

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 grea

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 > Hi Folks, > > I want to assert on an order of i

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 wrote: > > 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 yesterday: https:/

[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
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 wrote: > > > On Tue, Apr 14, 2009 at 6:06 AM, Korny Sietsma wrote: > >> In case anyone followed this: I got everything working pretty nicely - now