Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Jeremiah Heller
On 23 Dec 2008, at 23:07, Jeremiah Heller wrote: On 23 Dec 2008, at 18:26, Sarah Allen wrote: Matt Wynne wrote: ActiveRecord::Validations uses a trick that's used widely in rails, and is arguably[1] becoming a Ruby idiom, apparently. This is the interesting bit, around line #275: def se

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Jeremiah Heller
On 23 Dec 2008, at 18:26, Sarah Allen wrote: Matt Wynne wrote: ActiveRecord::Validations uses a trick that's used widely in rails, and is arguably[1] becoming a Ruby idiom, apparently. This is the interesting bit, around line #275: def self.included(base) # :nodoc: base.extend Class

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
actually I didn't check in so I can't do a diff :( I did move the creation of the row in "interest_rates" from the helper to the example setup, i.e. this bit: InterestRate.create!(:rate => 5.0, :start_date => Time.now.to_date.years_ago(1), :bank_account_id => @destn_bank.id) but I'm not sure

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread David Chelimsky
On Tue, Dec 23, 2008 at 10:53 PM, Greg Hauptmann wrote: > PSS. Note sure why, however now it seems "rake spec" is working. Did make > some minor changes to the spec but nothing I would have thought that would > have solved this...ummm What changes? > > On Wed, Dec 24, 2008 at 11:56 AM, Greg Ha

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
PSS. Note sure why, however now it seems "rake spec" is working. Did make some minor changes to the spec but nothing I would have thought that would have solved this...ummm On Wed, Dec 24, 2008 at 11:56 AM, Greg Hauptmann < greg.hauptmann.r...@gmail.com> wrote: > PS. I do call the method in a

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Sarah Allen
Matt Wynne wrote: > ActiveRecord::Validations uses a trick that's used widely in rails, > and is arguably[1] becoming a Ruby idiom, apparently. > > This is the interesting bit, around line #275: > > def self.included(base) # :nodoc: >base.extend ClassMethods > > So basically that me

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
PS. I do call the method in a before(:each)... describe Recurring, '.add_projections (interest)' do include RecurringSpecHelper before(:each) do load_bank_account_base_fixtures # <=== Called Here @destn_bank.should_not be_nil . . .

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
Hi, Here's an example (below) of the errors I get when I run "rake spec", however they don't occur when I run "spec ". The issue seems to be that when I call a help method which is "included" there is a point it adds an interest rate row to a table. In the successful case it appears this works,

Re: [rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread David Chelimsky
On Tue, Dec 23, 2008 at 8:29 PM, Greg Hauptmann wrote: > Hi, > > Does anyone know why I would have some spec's failing when using > "./script/autospec" or "rake spec", however when I just run them using "ruby > " it passes ok"? What's the difference in kicking off a spec by > these different mea

Re: [rspec-users] how can I run a spec in DEBUG mode (e.g. like rdebug )

2008-12-23 Thread David Chelimsky
On Tue, Dec 23, 2008 at 8:34 PM, Greg Hauptmann wrote: > Hi, > > Is there a way to run a spec in debug mode (using rdebug) so I can use > breakpoints in my spec code? rdebug path/to/my_spec.rb > > I ask this noting I've got some differences in specs passing/failing > depending on whether I run t

[rspec-users] how can I run a spec in DEBUG mode (e.g. like rdebug )

2008-12-23 Thread Greg Hauptmann
Hi, Is there a way to run a spec in debug mode (using rdebug) so I can use breakpoints in my spec code? I ask this noting I've got some differences in specs passing/failing depending on whether I run the spec via "ruby " as opposed to "rake spec". (raised in separate thread) thanks

[rspec-users] why does "ruby " work, but "rake spec" give spec errors?

2008-12-23 Thread Greg Hauptmann
Hi, Does anyone know why I would have some spec's failing when using "./script/autospec" or "rake spec", however when I just run them using "ruby " it passes ok"? What's the difference in kicking off a spec by these different means? Only thing that comes to mind is perhaps using "ruby " is mayb

Re: [rspec-users] [cucumber] screenshot upon exception

2008-12-23 Thread Tim Walker
>> Cucumber itself is not forking anything though. Sure it is, Cucumber is forking cool. Tim On Tue, Dec 23, 2008 at 4:49 PM, aslak hellesoy wrote: > > > On Tue, Dec 23, 2008 at 1:12 PM, aidy lewis > wrote: >> >> Hi Aslak, >> >> Thanks for the heads-up, but it seems the AfterStep block is only

Re: [rspec-users] [cucumber] screenshot upon exception

2008-12-23 Thread aslak hellesoy
On Tue, Dec 23, 2008 at 1:12 PM, aidy lewis wrote: > Hi Aslak, > > Thanks for the heads-up, but it seems the AfterStep block is only > executed if a step passes and not if it fails, is pending, skipped or > non-implemented. > > I tried to run a debugger on it to see what happens, but I think > Cuc

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Tim Walker
Ahh...reality is overrated. Thanks again for your help guys. Making a lot of sense. If I could get rcumber working that's be awesome. Tim On Tue, Dec 23, 2008 at 4:39 PM, aslak hellesoy wrote: > > > On Wed, Dec 24, 2008 at 12:10 AM, Tim Walker wrote: >> >> Very nice indeed... >> >> >> In your

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread aslak hellesoy
On Wed, Dec 24, 2008 at 12:10 AM, Tim Walker wrote: > Very nice indeed... > > > In your blog you said: > > "Note that one of the steps is already defined in webrat. Isn't that > cool? As you get the hang of this, you reuse certain word patterns > which map to specific tests. But we're getting ahe

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Tim Walker
Very nice indeed... In your blog you said: "Note that one of the steps is already defined in webrat. Isn't that cool? As you get the hang of this, you reuse certain word patterns which map to specific tests. But we're getting ahead of ourselves. We need to dive into the creation of "steps" which

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread s.ross
Bingo! module ActionController Dispatcher.class_eval do def self.failsafe_response(output, status, exception = nil) raise exception end end end And it works with vendor rails. (It would break every story run against versions < 2.2.2, but that's another issue.) Gem rails of

Re: [rspec-users] [cucumber] screenshot upon exception

2008-12-23 Thread Mischa Fierer
Hi, I have not had any trouble opening the debugger in cucumber. Then "debug" do debugger stop_here = 1 end M On Tue, Dec 23, 2008 at 4:12 AM, aidy lewis wrote: > Hi Aslak, > > Thanks for the heads-up, but it seems the AfterStep block is only > executed if a step passes and not if it fails

Re: [rspec-users] After block

2008-12-23 Thread Mischa Fierer
you could mess around with what cucumber is doing, like @__executor.instance_variable_get("@executed_scenarios") There may be an easier way that I'm not aware of. On Tue, Dec 23, 2008 at 8:26 AM, aidy lewis wrote: > Hi, > > Is the way to figure out the the last scenario executed in the Afte

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread Maurício Linhares
Also, the name isn't Dispatcher anymore, it's ActionController::Dispatcher. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Tue, Dec 23, 2008 at 7:26 PM, Mischa Fierer wrote: > from > /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.13/bin/../li

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread Mischa Fierer
from /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.13/bin/../lib/cucumber/rails/world.rb:18 Here's line 18: Dispatcher.class_eval do def self.failsafe_response(output, status, exception = nil) raise exception end end I would do the following: 1) Try it with gem rails on the old projec

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread Maurício Linhares
On Tue, Dec 23, 2008 at 7:04 PM, s.ross wrote: > Hello-- > > A bit stranger than that, I'm afraid. A fresh Rails project works with > cucumber right out of the box. This older one, recently upgraded to 2.2.2, > has the problem with dependencies.rb. The main difference is that the fresh > project i

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread s.ross
Hello-- On Dec 23, 2008, at 11:46 AM, Maurício Linhares wrote: I had a problem just like this with "has_many_polymorphs" and it was a bad require ( it was requiring "dispatcher" when it should be requiring "action_controller/dispatcher") Maybe a "require 'action_controller/dispatcher'" could s

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Matt Wynne
On 22 Dec 2008, at 19:09, Sarah Allen wrote: I realize this is off-topic for the RSpec forum and cucumber tutorial, but I'm hoping you'll enlighten me on this point which is, I guess, more of a Ruby language question... My Task model is simply defined (by the generate scaffold script) as: c

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread Maurício Linhares
I had a problem just like this with "has_many_polymorphs" and it was a bad require ( it was requiring "dispatcher" when it should be requiring "action_controller/dispatcher") Maybe a "require 'action_controller/dispatcher'" could solve your issue. - Maurício Linhares http://alinhavado.wordpress.co

[rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread s.ross
I'm running into a problem getting any results from Cucumber at this point. I was able to a while ago, but I upgraded to Rails 2.2.2 and poof! No Cucumber. Any thoughts what might be wrong? Rails 2.2.2 Cucumber 0.1.13 Webrat aslakhellesoy-webrat (0.3.2.1) rspec (1.1.11) rspec-rails (1.1.11)

[rspec-users] After block

2008-12-23 Thread aidy lewis
Hi, Is the way to figure out the the last scenario executed in the After block? Aidy ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] [cucumber] rcumber resource mapping

2008-12-23 Thread Tim Walker
Hi Guys, Just installed rcumber and added the following to routes.rb, etc. map.rcumber 'rcumber', :controller => 'rcumbers', :action => 'index' map.resources :rcumbers do |rcumber| rcumber.run 'run', :controller => 'rcumbers', :action => 'run' end When browsing to page at: http://local

Re: [rspec-users] Routing error with webrat

2008-12-23 Thread Juanma Cervera
> I think this is a bug, but I don't know. Well, I see all more clear now. I thought it was a bug because I thought it was failing only when running the feature, and it worked without problem hitting the application with the browser. But this was not true. It worked because I had index.html in /p

Re: [rspec-users] understanding "within"

2008-12-23 Thread Rick DeNatale
On Mon, Dec 22, 2008 at 11:30 PM, Jeremiah Heller wrote: > On 22 Dec 2008, at 16:03, Sarah Allen wrote: > >> Could someone describe what "table > tr:nth-child(#{pos.to_i+1})" does? >> by semantic pattern matching I could guess that "ol > >> li:nth-child(#{pos.to_i+1})" would also work, but it woul

Re: [rspec-users] Routing error with webrat

2008-12-23 Thread Juanma Cervera
Thanks Matt. You were right, I have modified routes.rb with mapping root url but I did't understand why this is needed. The create action in sessions controller is completely standar. The sentence that is causing the error redirect_back_or_default('/') is not using thr root_url. I think this i

Re: [rspec-users] [cucumber] screenshot upon exception

2008-12-23 Thread aidy lewis
Hi Aslak, Thanks for the heads-up, but it seems the AfterStep block is only executed if a step passes and not if it fails, is pending, skipped or non-implemented. I tried to run a debugger on it to see what happens, but I think Cucumber is opening another Ruby process and preventing me from debug

Re: [rspec-users] Routing error with webrat

2008-12-23 Thread Matt Wynne
On 23 Dec 2008, at 09:04, Juanma Cervera wrote: Hello I am starting using cucumber with an app using restful_authentication. I am having an error that is driving me mad. I am using this step Given /^que he hecho login en la aplicación$/ do user = User.create!( :login => "mi_login",

[rspec-users] Routing error with webrat

2008-12-23 Thread Juanma Cervera
Hello I am starting using cucumber with an app using restful_authentication. I am having an error that is driving me mad. I am using this step Given /^que he hecho login en la aplicación$/ do user = User.create!( :login => "mi_login", :name => "mi_nombre", :email => "mi_lo...

Re: [rspec-users] understanding "within"

2008-12-23 Thread Pau Cor
Sarah Allen wrote: > What if I wanted to destroy the lorry with "name 3" instead of the 3rd > lorry? I was trying to solve a similar problem a few weeks ago. You might be interested in the response I got: http://www.ruby-forum.com/topic/171269 HTH Paul -- Posted via http://www.ruby-forum.com/.