Re: [rspec-users] Cucumber - step negating another expecting step

2009-04-23 Thread John Goodsen
On Thu, Apr 23, 2009 at 1:53 AM, aslak hellesoy wrote: > > > Frankly, I don't think I'll ever implement a cute feature in Cucumber that > allows you to have out of the box negation. It would be ugly no matter how > it's done, and it would only save you a line or 2 of code. > fwiw, +1 on that. re

Re: [rspec-users] Cucumber - step negating another expecting step

2009-04-23 Thread Joaquin Rivera Padron
> > Frankly, I don't think I'll ever implement a cute feature in Cucumber that >> allows you to have out of the box negation. It would be ugly no matter how >> it's done, and it would only save you a line or 2 of code. >> > > fwiw, +1 on that. refactor to a descriptive method and get used to > ref

Re: [rspec-users] Select box with Webrat

2009-04-23 Thread mikej
Thanks for the response. I think I tried that one, still get the response: The 'Pollution' option was not found in the "temp_aspect_topic_id" select box (Webrat::NotFoundError) Any more thought? Mike ___ rspec-users mailing list rspec-users@rubyforge.

Re: [rspec-users] Select box with Webrat

2009-04-23 Thread mikej
Thanks for the response. I think I tried that one, still get the response: The 'Pollution' option was not found in the "temp_aspect_topic_id" select box (Webrat::NotFoundError) Any more thought? Mike ___ rspec-users mailing list rspec-users@rubyforge.

Re: [rspec-users] Select box with Webrat

2009-04-23 Thread Zach Dennis
On Thu, Apr 23, 2009 at 4:34 AM, mikej wrote: > Thanks for the response.  I think I tried that one, still get the > response: > > The 'Pollution' option was not found in the "temp_aspect_topic_id" > select box (Webrat::NotFoundError) > > Any more thought? Do you only have one select box on the pa

Re: [rspec-users] Cucumber - step negating another expecting step

2009-04-23 Thread Jeff Talbot
> > Then /^I (should|should not) see the people search form$/ do > |should_or_should_not| > expect_that(response, should_or_should_not, have_tag('form#frmSearch')) > end > > def expect_that(target, should_or_should_not, matcher) > target.send should_or_should_not.underscore.to_sym, matcher > end

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread James Byrne
Another question: Where should metaclass.rb go; lib? lib/spec? or should the method be put inside the spec_helper file? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinf

Re: [rspec-users] Cucumber - step negating another expecting step

2009-04-23 Thread David Chelimsky
On Thu, Apr 16, 2009 at 10:35 AM, Matt Wynne wrote: > > On 16 Apr 2009, at 14:06, Joaquin Rivera Padron wrote: > >> thanks matt, >> yes, the regexp in the step matcher is a good one to dry it up >> >> So I end up with this one: >> >> Then /^I (should|should not) see the people search form$/ do |ma

Re: [rspec-users] Cucumber - step negating another expecting step

2009-04-23 Thread David Chelimsky
On Thu, Apr 23, 2009 at 9:39 AM, Ben Mabey wrote: > David Chelimsky wrote: >> >> On Thu, Apr 16, 2009 at 10:35 AM, Matt Wynne wrote: >> >>> >>> On 16 Apr 2009, at 14:06, Joaquin Rivera Padron wrote: >>> >>> thanks matt, yes, the regexp in the step matcher is a good one to dry it up

[rspec-users] About the use of Scenario Outline for validation stuff

2009-04-23 Thread Jérémy FRERE
Hi there ! I was wondering if the way I test the validation of my forms is right or not. So here's a little example : Imagine you have a form with some validations designed to create some object. You want to test it using Scenario Outline and Examples. So you fill in the fields using , and press th

Re: [rspec-users] Cucumber - step negating another expecting step

2009-04-23 Thread Ben Mabey
David Chelimsky wrote: On Thu, Apr 16, 2009 at 10:35 AM, Matt Wynne wrote: On 16 Apr 2009, at 14:06, Joaquin Rivera Padron wrote: thanks matt, yes, the regexp in the step matcher is a good one to dry it up So I end up with this one: Then /^I (should|should not) see the people search

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread David Chelimsky
On Thu, Apr 23, 2009 at 11:08 AM, James Byrne wrote: > Another question: Where should metaclass.rb go; lib? lib/spec? or should > the method be put inside the spec_helper file? This is a utility for matchers to give good messages, so I'd put it in lib/spec/matchers I don't think we should call i

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly spe cing

2009-04-23 Thread Fernando Perez
Rails definitely entices you to break Demeter's law just so often. Now how to cleanly spec: @comment = @article.comments.build(params[:comment]) ? Mocking and stubbing is starting to get ugly now. -- Posted via http://www.ruby-forum.com/. ___ rspec-u

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly spe cing

2009-04-23 Thread Zach Dennis
On Thu, Apr 23, 2009 at 2:19 PM, Fernando Perez wrote: > Rails definitely entices you to break Demeter's law just so often. > > Now how to cleanly spec: > > @comment = @article.comments.build(params[:comment]) ? You think that's bad, I've seen many a code that looks like: project.tasks.map(&:res

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread James Byrne
David Chelimsky wrote: > > > I don't think we should call it metaclass though, but I'm not sure > what I *do* want to call it. Metaclass != eigenclass, which is what > this really is, so maybe eigenclass.rb - don't let that hang you up > though, I can always change the names after. > The thing i

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread David Chelimsky
On Thu, Apr 23, 2009 at 1:56 PM, James Byrne wrote: > David Chelimsky wrote: >> >> >> I don't think we should call it metaclass though, but I'm not sure >> what I *do* want to call it. Metaclass != eigenclass, which is what >> this really is, so maybe eigenclass.rb - don't let that hang you up >>

[rspec-users] Style issue

2009-04-23 Thread James Byrne
In one of my features I have to check to see if a file is created by an external script and then determine if that file contains specific information. So, I ended up with these step definitions: When /currency exchange rate transfer file should contain rates/ do found = false fx_code = 'USD'

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread James Byrne
David Chelimsky wrote: > On Thu, Apr 23, 2009 at 1:56 PM, James Byrne > wrote: >> for that method before extending Object with my own. If >> Object.respond_to? :metaclass == true then we are in Rails, or some >> other framework that provides the same thing, and so we need not provide >> our own.

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread James Byrne
David Chelimsky wrote: > I'd rather always define our own so the results are consistent from > RSpec regardless of other frameworks in the midst. Does that make > sense to you? Instead of metaclass how about object_handle ? wdt? -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread David Chelimsky
On Thu, Apr 23, 2009 at 2:26 PM, James Byrne wrote: > David Chelimsky wrote: > >> I'd rather always define our own so the results are consistent from >> RSpec regardless of other frameworks in the midst. Does that make >> sense to you? > > Instead of metaclass how about object_handle ? > > wdt? G

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly spe cing

2009-04-23 Thread Stephen Eley
On Thu, Apr 23, 2009 at 2:19 PM, Fernando Perez wrote: > Rails definitely entices you to break Demeter's law just so often. So fix it. It's usually just a matter of putting in some delegators. If you don't like @article.comments.build, you can declare your own Article.build_comment() method and

Re: [rspec-users] Style issue

2009-04-23 Thread Mark Wilden
On Thu, Apr 23, 2009 at 12:05 PM, James Byrne wrote: > When /currency exchange rate transfer file should contain rates/ do > found = false > fx_code = 'USD' > File.open(FOREX_XFR_FN).each do |line| > found = true if > /.*fx_target#{fx_code}.*fx_rate(\d+\.\d{4}).*/.match(line) > break if foun

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread James Byrne
David Chelimsky wrote: > On Thu, Apr 23, 2009 at 2:26 PM, James Byrne > wrote: >> David Chelimsky wrote: >> >>> I'd rather always define our own so the results are consistent from >>> RSpec regardless of other frameworks in the midst. Does that make >>> sense to you? >> >> Instead of metaclass ho

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread David Chelimsky
On Thu, Apr 23, 2009 at 3:16 PM, James Byrne wrote: > David Chelimsky wrote: >> On Thu, Apr 23, 2009 at 2:26 PM, James Byrne >> wrote: >>> David Chelimsky wrote: >>> I'd rather always define our own so the results are consistent from RSpec regardless of other frameworks in the midst. Do

Re: [rspec-users] Style issue

2009-04-23 Thread James Byrne
Mark Wilden wrote: > I find this more straighforward and easy to understand: > > When /currency exchange rate transfer file should contain rates/ do > fx_code = 'USD' > File.open(FOREX_XFR_FN).each do |line| > return true if > /.*fx_target#{fx_code}.*fx_rate(\d+\.\d{4}).*/.match(line) >

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread David Chelimsky
On Thu, Apr 23, 2009 at 3:17 PM, David Chelimsky wrote: > On Thu, Apr 23, 2009 at 3:16 PM, James Byrne wrote: >> David Chelimsky wrote: >>> On Thu, Apr 23, 2009 at 2:26 PM, James Byrne >>> wrote: David Chelimsky wrote: > I'd rather always define our own so the results are consisten

Re: [rspec-users] Style issue

2009-04-23 Thread Mark Wilden
On Thu, Apr 23, 2009 at 1:18 PM, James Byrne wrote: > Mark Wilden wrote: > > > I find this more straighforward and easy to understand: > > > > When /currency exchange rate transfer file should contain rates/ do > > fx_code = 'USD' > > File.open(FOREX_XFR_FN).each do |line| > > return tru

Re: [rspec-users] Style issue

2009-04-23 Thread Zach Dennis
On Thu, Apr 23, 2009 at 3:59 PM, Mark Wilden wrote: >  On Thu, Apr 23, 2009 at 12:05 PM, James Byrne wrote: > >> When /currency exchange rate transfer file should contain rates/ do >> found = false >> fx_code = 'USD' >> File.open(FOREX_XFR_FN).each do |line| >>   found = true if >> /.*fx_target#{

Re: [rspec-users] Style issue

2009-04-23 Thread Zach Dennis
On Thu, Apr 23, 2009 at 8:11 PM, Zach Dennis wrote: > On Thu, Apr 23, 2009 at 3:59 PM, Mark Wilden wrote: >>  On Thu, Apr 23, 2009 at 12:05 PM, James Byrne wrote: >> >>> When /currency exchange rate transfer file should contain rates/ do >>> found = false >>> fx_code = 'USD' >>> File.open(FOREX_

Re: [rspec-users] [Cucumber] Textmate support for Background

2009-04-23 Thread Tim Walker
Done. Many thanks! http://github.com/bmabey/cucumber-tmbundle/issues/#issue/1 Title: Support for Background (uh, Scenario?) Body: Would like support (Text Highlighting, Code Snippet) for the Cucumber "Background" key word. I'd imagine this would be a code snippet just like Scenario. Best regards

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread James Byrne
David Chelimsky wrote: > On Wed, Apr 22, 2009 at 2:09 PM, James Byrne > wrote: � � � (Spec::Expectations::ExpectationNotMetError) >> Rates" >> WDYT? > I like the idea, though I think it's helpful to also have the strings > in the case of String objects. But having the class and object id > w

Re: [rspec-users] Cucumber ".should contain(expected) does but fails anyway

2009-04-23 Thread James Byrne
David Chelimsky wrote: > On Thu, Apr 23, 2009 at 3:16 PM, James Byrne > wrote: >> to stick the object_handle method in the right place and get the revised >> specs to pass. �I should have a patch for you tomorrow. If not, then by >> Monday. > > Cool. I may need to get a release out before t

Re: [rspec-users] About the use of Scenario Outline for validation stuff

2009-04-23 Thread Matt Wynne
On 23 Apr 2009, at 17:03, Jérémy FRERE wrote: Hi there ! I was wondering if the way I test the validation of my forms is right or not. So here's a little example : Imagine you have a form with some validations designed to create some object. You want to test it using Scenario Outline and

[rspec-users] [Cucumber, Rails] Load path hell with plugins /extensions

2009-04-23 Thread Ken Mayer
I discovered this while debugging a RadiantCMS extension: cucumber uses 'require' to load step definitions, _and_ since I loaded the rails environment (in features/support/env.rb) for testing, _and_ radiant necessarily adds extensions to the load path, the path to _every_ extension in your