Re: [rspec-users] `add_example_group': undefined method `deprecate' for Spec:Module (NoMethodError)

2009-04-15 Thread David Chelimsky
On Wed, Apr 15, 2009 at 11:10 AM, vanweerd wrote: > I'm the getting the following error when running rspec on a rails > project. > > /Users/vanweerd/work2/innerplate/vendor/plugins/rspec/lib/spec/runner/ > formatter/base_formatter.rb:52:in `add_example_group': undefined > method `deprecate' for Sp

[rspec-users] `add_example_group': undefined method `deprecate' for Spec:Module (NoMethodError)

2009-04-15 Thread vanweerd
I'm the getting the following error when running rspec on a rails project. /Users/vanweerd/work2/innerplate/vendor/plugins/rspec/lib/spec/runner/ formatter/base_formatter.rb:52:in `add_example_group': undefined method `deprecate' for Spec:Module (NoMethodError) from /Library/Ruby/Gems/1.8/

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

2009-04-15 Thread Wolfram Arnold
Thanks to all for the prompt answer and new docs!!! -- 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] Rate my code: refactoring from spec

2009-04-15 Thread Pat Maddox
On Wed, Apr 15, 2009 at 9:36 AM, Fernando Perez wrote: > Hi, > > I used to have the following method: > > def Paypal.process_ipn(params) >  ... >  paypal = create!(params) >  paypal.order.update_from_ipn(completed?) > end > > That method obviously is not easily specable because of the double dot >

[rspec-users] Rate my code: refactoring from spec

2009-04-15 Thread Fernando Perez
Hi, I used to have the following method: def Paypal.process_ipn(params) ... paypal = create!(params) paypal.order.update_from_ipn(completed?) end That method obviously is not easily specable because of the double dot method call, and when specing it, it would hit the DB for nothing. I used

Re: [rspec-users] Cucumber features for RSS feeds

2009-04-15 Thread James Byrne
Q. Is there anything special about the Rails test environment that would inhibit an ActivieResource object from connecting to an outside URL? I am presently working inside the console with this expression: >> forex = ForexCASource.find and receiving a 404 error. The resource is defined as: cl

Re: [rspec-users] How to test/spec an ActiveRecord find that uses :include

2009-04-15 Thread Pat Maddox
You have to hit the db here to make sure that it works. Can't isolate all the time, especially when building database-centric apps ;) As for testing it, the easiest way I know of to test the association was included is to check #loaded? on the proxy. h = Harbor.first h.marinas.should be_loaded

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

2009-04-15 Thread Pat Maddox
You can use IO.popen to run and interact with a command line program. Pat On Tue, Apr 14, 2009 at 1:58 PM, 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. > > I'm thinking of writing a feature that looks so

Re: [rspec-users] RSpec makes me want to write better code

2009-04-15 Thread Fernando Perez
> 6 months since my initial post, what happened in between? Damn! BDD + writing specs that don't hit the database, also taught me to not break Demeter's law :-D It's simply a huge pain to spec a double dot method call, i.e: user.membership.paid? ActiveRecord associations are super, but they c

Re: [rspec-users] [ANN] rspec 1.2.4 Released

2009-04-15 Thread Lenny Marks
Just tried it out. Something missed? -lenny > cat t.rb describe 'test' do it "should not fail" do ['A'].should include('A') end end > spec -v rspec 1.2.4 > spec t.rb F 1) NoMethodError in 'test should not fail' undefined method `helper' for # t.rb:3: On Apr 15, 2009, at 10:18 AM,

Re: [rspec-users] Specs for RSpec Matchers and Helpers

2009-04-15 Thread Mark Wilden
On Wed, Apr 15, 2009 at 7:52 AM, Brandon Olivares wrote: > > I've been extracting a lot of code out of my specs into their own matchers, > helpers, and macros. > > I notice that the plugins that have their own specs, such as rspec-rails, > and even RSpec itself, have specs for the matchers and hel

Re: [rspec-users] How to test/spec an ActiveRecord find that uses :include

2009-04-15 Thread Fernando Perez
> What's wrong with hitting the database? Actually it slows tests down like hell. I was able to ÷10 my testing time by not hitting the DB as much as I used to. But I think that hitting DB for such case is acceptable. -- Posted via http://www.ruby-forum.com/. _

Re: [rspec-users] How to test/spec an ActiveRecord find that uses :include

2009-04-15 Thread Matt Wynne
On 15 Apr 2009, at 15:30, Phlip wrote: Fernando Perez wrote: I was refactoring my model specs so that they don't hit the database, but how to handle a custom find that uses :joins or :include with some important :conditions? I can't see a way to not hit the database. What's wrong with hi

Re: [rspec-users] How to test/spec an ActiveRecord find that uses :include

2009-04-15 Thread Phlip
Fernando Perez wrote: I was refactoring my model specs so that they don't hit the database, but how to handle a custom find that uses :joins or :include with some important :conditions? I can't see a way to not hit the database. What's wrong with hitting the database? When high-end consultant

Re: [rspec-users] Specs for RSpec Matchers and Helpers

2009-04-15 Thread aslak hellesoy
On Wed, Apr 15, 2009 at 4:52 PM, Brandon Olivares wrote: > Hi, > > I've been extracting a lot of code out of my specs into their own matchers, > helpers, and macros. > > I notice that the plugins that have their own specs, such as rspec-rails, > and even RSpec itself, have specs for the matchers a

[rspec-users] Specs for RSpec Matchers and Helpers

2009-04-15 Thread Brandon Olivares
Hi, I've been extracting a lot of code out of my specs into their own matchers, helpers, and macros. I notice that the plugins that have their own specs, such as rspec-rails, and even RSpec itself, have specs for the matchers and helpers. Is this generally a good thing to do, or is it unnecessary

[rspec-users] [ANN] rspec 1.2.4 Released

2009-04-15 Thread David Chelimsky
rspec version 1.2.4 has been released! Be sure to check History.rdoc and Updgrade.rdoc at http://rspec.rubyforge.org/rspec/1.2.4/ before upgrading. * * * * Behaviour Driven Development for Ruby.

[rspec-users] How to test/spec an ActiveRecord find that uses :include

2009-04-15 Thread Fernando Perez
Hi, I was refactoring my model specs so that they don't hit the database, but how to handle a custom find that uses :joins or :include with some important :conditions? I can't see a way to not hit the database. Should that spec actually belong to an integration spec? -- Posted via http://www.rub

[rspec-users] Ambigous error while running cucumber features

2009-04-15 Thread Neema Cheriyath
Hello, I was just trying out a cucumber-java example with selenium integrated. My feature file has two scenarios and while executing the command "cucumber features", It is executing the first scenario succesfully, but for the second scenario I am getting the ambiguity error (Cucumber::Ambig

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

2009-04-15 Thread Matt Wynne
Yeah this is all good stuff. We're basically talking about 'personal CI' here I think[1]. Nothing wrong with that, but we must remember some of this can be deferred until check-in. [1]http://silkandspinach.net/2009/01/18/a-different-use-for-cruisecontrol/ On 14 Apr 2009, at 21:13, Andrew P

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

2009-04-15 Thread Matt Wynne
On 14 Apr 2009, at 16:14, Brandt Kurowski wrote: 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 mix

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

2009-04-15 Thread aslak hellesoy
On Wed, Apr 15, 2009 at 8:46 AM, Colfer, Brian wrote: > 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. > By LDAP protected site - do you mean a web application that h

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

2009-04-15 Thread aslak hellesoy
On Wed, Apr 15, 2009 at 6:34 AM, Ben Mabey wrote: > 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