Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread doug livesey
And of course the pinnacle of geekdom is to be known as a 'poodle', or one who is skilled in being skilled; a fu-fu.Damn', I appear to be posting drunk again ... 2009/1/30 Rick DeNatale > > > On Fri, Jan 30, 2009 at 10:06 AM, David Chelimsky wrote: > >> On Fri, Jan 30, 2009 at 8:49 AM, James Byr

Re: [rspec-users] nokogiri selector help

2009-01-30 Thread Jonathan Linowes
On Jan 25, 2009, at 11:58 AM, Zach Dennis wrote: On Sat, Jan 24, 2009 at 12:05 AM, Jonathan Linowes wrote: hiya, i want the selector that would return a of a table if any td contains some text, so i can use it in click_link_within e.g. When I click the "show" link within the row contain

Re: [rspec-users] RSpec get model attribute values by name

2009-01-30 Thread Pat Maddox
On Fri, Jan 30, 2009 at 3:56 PM, James Byrne wrote: > Zach Dennis wrote: > >> >> m = MyModel.new :name => "foo" >> m["name"] # => "foo" >> >> http://www.railsbrain.com/api/rails-2.2.2/doc/index.html?a=M001972&name=[] >> >> On a different note, how about some better variable names? > > That co

Re: [rspec-users] RSpec get model attribute values by name

2009-01-30 Thread James Byrne
Zach Dennis wrote: > > m = MyModel.new :name => "foo" > m["name"] # => "foo" > > http://www.railsbrain.com/api/rails-2.2.2/doc/index.html?a=M001972&name=[] > > On a different note, how about some better variable names? That code was for demonstration purposes for this question only. -- P

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-30 Thread Rick DeNatale
On Fri, Jan 30, 2009 at 1:36 PM, David Chelimsky wrote: > On Fri, Jan 30, 2009 at 12:00 PM, Rick DeNatale > wrote: > > On Thu, Jan 29, 2009 at 7:33 PM, David Chelimsky > > wrote: > >> > >> > I agree this discussion should move to a ticket. But it seems I am to > >> > lazy > >> > to do it myself

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread Pat Nakajima
Glad it works. Just so you know, you can get created_at and updated_at by calling #timestamps: require 'rubygems' require 'acts_as_fu' require 'spec' describe "timestamps" do before(:each) do build_model(:people) { timestamps } @person = Person.create!

Re: [rspec-users] RSpec get model attribute values by name

2009-01-30 Thread James Byrne
James Byrne wrote: > This is a request for a programming technique: Got it... t1.read_attribute(column) -- 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] RSpec get model attribute values by name

2009-01-30 Thread Zach Dennis
On Fri, Jan 30, 2009 at 3:45 PM, James Byrne wrote: > This is a request for a programming technique: > > Given > > class Mymodel < ActiveRecord::Base > end > > my_instance = Mymodel.new > > If I am given a string representation of an attribute "xxx" what is the > most elegant way of passing that s

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
James Byrne wrote: > Pat Nakajima wrote: >> James, >> >> Can you show me how you're trying to use ActsAsFu? >> >> Pat > > Not easily, because I removed the code. When I get a moment I will > reset it and post here. It will be later today. Here is what I have. FYI once I removed the custom l

[rspec-users] RSpec get model attribute values by name

2009-01-30 Thread James Byrne
This is a request for a programming technique: Given class Mymodel < ActiveRecord::Base end my_instance = Mymodel.new If I am given a string representation of an attribute "xxx" what is the most elegant way of passing that string to my_instance to retrieve its value? This is probably a common

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-30 Thread David Chelimsky
On Fri, Jan 30, 2009 at 12:00 PM, Rick DeNatale wrote: > On Thu, Jan 29, 2009 at 7:33 PM, David Chelimsky > wrote: >> >> > I agree this discussion should move to a ticket. But it seems I am to >> > lazy >> > to do it myself ;) >> >> http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/669 >

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > James, > > Can you show me how you're trying to use ActsAsFu? > > Pat Not easily, because I removed the code. When I get a moment I will reset it and post here. It will be later today. -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-30 Thread Rick DeNatale
On Thu, Jan 29, 2009 at 7:33 PM, David Chelimsky wrote: > > > I agree this discussion should move to a ticket. But it seems I am to > lazy > > to do it myself ;) > > http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/669 > > Nice to see you step back from the list of suggestions and nicely

Re: [rspec-users] Strange message expectation behaviour with Time.now in a find condition

2009-01-30 Thread Pat Maddox
On Fri, Jan 30, 2009 at 9:05 AM, Mark Wilden wrote: > On Fri, Jan 30, 2009 at 7:38 AM, David Chelimsky > wrote: >> >> On Fri, Jan 30, 2009 at 9:17 AM, Mark Wilden wrote: >> > Avdi Grimm wrote a blog post about why he doesn't stub Time.now and >> > instead >> > always injects a clock into his obj

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > After taking another look, I think you may be able to do something > like this to test your logger: > https://gist.github.com/3c55cbec990f283c5399 I am not trying to test my custom logger. That part has worked for a few weeks now. What is happening is that RSpec is blowin

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Rick DeNatale
On Fri, Jan 30, 2009 at 10:06 AM, David Chelimsky wrote: > On Fri, Jan 30, 2009 at 8:49 AM, James Byrne wrote: > > Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, > > gems and such? > > > > I have run across this suffix a number of times in Ruby and Rails, > > always in conn

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread Pat Nakajima
After taking another look, I think you may be able to do something like this to test your logger: https://gist.github.com/3c55cbec990f283c5399 Let me know if that works. Pat On Jan 30, 11:10 am, James Byrne wrote: > Pat Nakajima wrote: > > If you want an easy way to test ActiveRecord extensions

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread Pat Nakajima
James, Can you show me how you're trying to use ActsAsFu? Pat On Jan 30, 11:52 am, James Byrne wrote: > Pat Nakajima wrote: > > If you want an easy way to test ActiveRecord extensions, check out > > acts_as_fu:http://github.com/nakajima/acts_as_fu. It makes generating > > ActiveRecord models de

Re: [rspec-users] Cucumber resource routes

2009-01-30 Thread Peter Fitzgibbons
See, I told you it was horribly obvious! *blush* Thanks Thomas, David. Peter Fitzgibbons (847) 687-7646 Email: peter.fitzgibb...@gmail.com IM GTalk: peter.fitzgibbons IM Yahoo: pjfitzgibbons IM MSN: pjfitzgibb...@hotmail.com IM AOL: peter.fitzgibb...@gmail.com On Fri, Jan 30, 2009 at 8:26 AM,

Re: [rspec-users] Strange message expectation behaviour with Time.now in a find condition

2009-01-30 Thread Mark Wilden
On Fri, Jan 30, 2009 at 7:38 AM, David Chelimsky wrote: > On Fri, Jan 30, 2009 at 9:17 AM, Mark Wilden wrote: > > Avdi Grimm wrote a blog post about why he doesn't stub Time.now and > instead > > always injects a clock into his objects. I disagreed, but I can't seem to > > find the article now. >

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > If you want an easy way to test ActiveRecord extensions, check out > acts_as_fu: http://github.com/nakajima/acts_as_fu. It makes generating > ActiveRecord models dead simple. Perhaps I misunderstood what this gem is supposed to provide but when I call create! on an object p

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread Pat Nakajima
So, in acts_as_fu, I actually set the ActiveRecord logger to just log to a StringIO that you can inspect by calling ActsAsFu.log. That's not going to fly for your project though, so let me give the ability to set your own. It'll be committed soon. - Pat On Jan 30, 11:10 am, James Byrne wrote: >

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
James Byrne wrote: > > and when I run rake spec I see this: > > NameError in 'Role should create a new instance given valid attributes' > undefined local variable or method `logger' for > # > /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:471:in > > `meth

[rspec-users] [Cucumber] Passing a variable from rake to steps file

2009-01-30 Thread AndreXP
Can anybody tell me how to pass a variable from the rake command to my steps file using cucumber? I have the following in my Rakefile: ## Rakefile Cucumber::Rake::Task.new do |t| profile = ENV['PROFILE'] || 'default' browser_type = ENV['BROWSER'] || '*chrome' t.cucumber_opts = "--profile #

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > If you want an easy way to test ActiveRecord extensions, check out > acts_as_fu: http://github.com/nakajima/acts_as_fu. It makes generating > ActiveRecord models dead simple. > This seems to work very well. However, I am causing myself a problem with the logger and I coul

Re: [rspec-users] Strange message expectation behaviour with Time.now in a find condition

2009-01-30 Thread David Chelimsky
On Fri, Jan 30, 2009 at 9:17 AM, Mark Wilden wrote: > Avdi Grimm wrote a blog post about why he doesn't stub Time.now and instead > always injects a clock into his objects. I disagreed, but I can't seem to > find the article now. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/297660

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread James Byrne
Mark Wilden wrote: > On Fri, Jan 30, 2009 at 6:49 AM, James Byrne > wrote: > >> Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, >> gems and such? >> > > Kung fu. > Ah... Thanks. I understand the reference now. My own martial arts training leans more to FN than FU so I

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Pat Nakajima
Speaking as the author of a "-fu" project, I'll say that I named acts_as_fu that way because it aids the creation of ActiveRecord extensions, which very commonly have names starting with "acts_as" or ending with "fu". This sort of meta-extension of that workflow means that you can look at it in two

Re: [rspec-users] Strange message expectation behaviour with Time.now in a find condition

2009-01-30 Thread Mark Wilden
Avdi Grimm wrote a blog post about why he doesn't stub Time.now and instead always injects a clock into his objects. I disagreed, but I can't seem to find the article now. ///ark ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Yi Wen
This "Fu" you refer to is actually different than "Fu" as in "Kung-Fu". The fu as in kung-fu by itself, means husband. In Ancient Chinese, it also means wise person, such as confucius(Kong Fu Zi). On Fri, Jan 30, 2009 at 9:06 AM, David Chelimsky wrote: > On Fri, Jan 30, 2009 at 8:49 AM, James Byr

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Nick Hoffman
On 30/01/2009, at 9:49 AM, James Byrne wrote: Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, gems and such? I have run across this suffix a number of times in Ruby and Rails, always in connection with some add-on or extension. In the original context that I encountered '_

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Chris Flipse
Think Kung-Fu It's not an abbreviation, it's a suffix that's supposed to imply a certain level of kick-assery http://catb.org/jargon/html/F/suffix-fu.html On Fri, Jan 30, 2009 at 9:49 AM, James Byrne wrote: > Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, > gems and such

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Matt Wynne
On 30 Jan 2009, at 14:49, James Byrne wrote: Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, gems and such? I have run across this suffix a number of times in Ruby and Rails, always in connection with some add-on or extension. In the original context that I encountered '

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread David Chelimsky
On Fri, Jan 30, 2009 at 8:49 AM, James Byrne wrote: > Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, > gems and such? > > I have run across this suffix a number of times in Ruby and Rails, > always in connection with some add-on or extension. In the original > context that

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Mark Wilden
On Fri, Jan 30, 2009 at 6:49 AM, James Byrne wrote: > Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, > gems and such? > Kung fu. ///ark ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Ben Mabey
James Byrne wrote: Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, gems and such? I have run across this suffix a number of times in Ruby and Rails, always in connection with some add-on or extension. In the original context that I encountered '_fu' I inferred that it prob

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Stephen Eley
On Fri, Jan 30, 2009 at 9:49 AM, James Byrne wrote: > Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, > gems and such? >From "kung fu." It's a joke. -- Have Fun, Steve Eley (sfe...@gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepo

[rspec-users] OK... What is ... fu ?

2009-01-30 Thread James Byrne
Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, gems and such? I have run across this suffix a number of times in Ruby and Rails, always in connection with some add-on or extension. In the original context that I encountered '_fu' I inferred that it probably stood for file u

Re: [rspec-users] Cucumber resource routes

2009-01-30 Thread David Chelimsky
On Fri, Jan 30, 2009 at 8:10 AM, Peter Fitzgibbons wrote: > Hi all, > > I'm missing something basic here. > > Inside ./features/support/paths.rb I want to use a > ActionController::Resources helper for Products as mapped in routes.rb > > ./routes.rb > map.resource :product > > ./features/support/p

Re: [rspec-users] Cucumber resource routes

2009-01-30 Thread Thomas R. Koll
Hi, uhmmm 'project'.should be('product') Am 30.01.2009 um 15:10 schrieb Peter Fitzgibbons: Hi all, I'm missing something basic here. Inside ./features/support/paths.rb I want to use a ActionController::Resources helper for Products as mapped in routes.rb ./routes.rb map.resource :produc

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > (Sorry if this is double-posted, I was having trouble with joining the > list) > > If you want an easy way to test ActiveRecord extensions, check out > acts_as_fu: http://github.com/nakajima/acts_as_fu. It makes generating > ActiveRecord models dead simple. > > Pat This see

[rspec-users] Cucumber resource routes

2009-01-30 Thread Peter Fitzgibbons
Hi all, I'm missing something basic here. Inside ./features/support/paths.rb I want to use a ActionController::Resources helper for Products as mapped in routes.rb ./routes.rb map.resource :product ./features/support/paths.rb (abbreviated for clarity) def path_to(page_name) case page_name w

Re: [rspec-users] Strange message expectation behaviour with Time.now in a find condition

2009-01-30 Thread tatyree
Thanks for that everyone! Henceforth I shall always endeavour to stop the flow of time in all of my specs! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users