Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-30 Thread nruth
Hi Ash I've found let and before useful in different situations. I like let as a 'new feature' but am not sure it replaces, or is necessarily superior to, @vars in all cases for specs. If I want to set up a context to run some examples in (models created with machinist, associations, etc) then th

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 6:56 PM, Myron Marston wrote: > On Jul 30, 2:58 pm, Ashley Moran > wrote: >> On 30 Jul 2010, at 5:00 PM, David Chelimsky wrote: >> >>> By all means. >> >> I've started on that and filed a ticket[1]. >> >> One question I have, is I keep calling the Example Group that uses a

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread Myron Marston
I may be the only one who finds this useful, but I think there's value in evaluating the customization block after the shared example group block. It allows the shared example group to provide a default implementation of a helper method, and then an instance of the shared behavior to override the

Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-30 Thread Ashley Moran
On 30 Jul 2010, at 10:00 PM, nruth wrote: > http://gist.github.com/501296 > > I don't think anything needs to change, though a wrapper function > (each + an inner describe) might help flag it as a possible pitfall. Hi Nick I think the "before + ivar" pattern (below) is on its way out. At leas

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread Ashley Moran
On 30 Jul 2010, at 5:00 PM, David Chelimsky wrote: > By all means. I've started on that and filed a ticket[1]. One question I have, is I keep calling the Example Group that uses a shared block the "host group". Is there already a name for it? I never know what to use, and I'm not sure "host

Re: [rspec-users] rspec 1 - nested examples (in an each block) use the final block variable 4 times instead of each of the 4 once

2010-07-30 Thread nruth
Hi David I think this was a case of idiot-end-user (or developer) on my part, sorry about that. I've produced a simple example here (and figured out what I was doing wrong). http://gist.github.com/501296 I don't think anything needs to change, though a wrapper function (each + an inner describe

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread Ashley Moran
On Jul 30, 2010, at 4:47 pm, David Chelimsky wrote: > If I provide spec extensions for a library (other than RSpec in this case) > that include a shared group that "you can use to spec your foos to make sure > they comply with this API" (or whatever), then this sort of thing can be very > help

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 10:17 AM, Wincent Colaiuta wrote: > El 30/07/2010, a las 16:10, David Chelimsky escribió: > >> Actually - maybe I spoke to soon. Ordering things this way would mean that >> you couldn't do this: >> >> shared_examples_for Enumerable do >> def enumerable >> raise "you must

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 10:57 AM, Ashley Moran wrote: > > On Jul 30, 2010, at 3:10 pm, David Chelimsky wrote: > >> Maybe that, or a DSL that wraps that, is the better way, so we can get the >> best of both worlds? >> >> shared_examples_for Enumerable do >> require_instance_method :foo, "gotta hav

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread Ashley Moran
On Jul 30, 2010, at 3:10 pm, David Chelimsky wrote: > Maybe that, or a DSL that wraps that, is the better way, so we can get the > best of both worlds? > > shared_examples_for Enumerable do > require_instance_method :foo, "gotta have foo instance method" > require_class_method :foo, "gotta ha

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread Wincent Colaiuta
El 30/07/2010, a las 16:10, David Chelimsky escribió: > Actually - maybe I spoke to soon. Ordering things this way would mean that > you couldn't do this: > > shared_examples_for Enumerable do > def enumerable >raise "you must provide an enumerable method that returns the object which > yo

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 9:03 AM, David Chelimsky wrote: > > On Jul 30, 2010, at 5:13 AM, Ashley Moran wrote: > >> Hi >> >> I finally looked into why this is not currently possibly in RSpec 2 (beta >> 19): >> >> shared_examples_for "Etymology" do >> describe "The etymology of foo" do >> it

Re: [rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 5:13 AM, Ashley Moran wrote: > Hi > > I finally looked into why this is not currently possibly in RSpec 2 (beta 19): > > shared_examples_for "Etymology" do >describe "The etymology of foo" do > it "is followed by #{after_foo}" do ># ... > end >end

Re: [rspec-users] proposition: warn on rake spec - group :test

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 3:09 AM, Rainer Kuhn wrote: > On Jul 29, 3:29 pm, David Chelimsky wrote: >> On Jul 27, 2010, at 7:29 AM, Rainer Kuhn wrote: >> >>> Consider putting out some information on rake spec, when rspec ist >>> only defined in the :test group. >>> This just cost me an hour until I read

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 7:47 AM, Amit Jain wrote: > David Chelimsky wrote: >> On Jul 30, 2010, at 6:52 AM, Amit Jain wrote: >> > from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.8/bin/rcov:511 >>> >>> config.gem "rspec-rails", :version => ">= 1.3.2" >> >> OK - so the problem now is that

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-30 Thread Amit Jain
David Chelimsky wrote: > On Jul 30, 2010, at 6:52 AM, Amit Jain wrote: > from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.8/bin/rcov:511 >> >>config.gem "rspec-rails", :version => ">= 1.3.2" > > OK - so the problem now is that you've got rspec-rails 2.0.0.beta > installed and that

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 6:52 AM, Amit Jain wrote: > David Chelimsky wrote: >> On Jul 30, 2010, at 2:03 AM, Amit Jain wrote: >> rails. Please do this: it using some means other than what is recommended by Rails, which is to David >>> (NameError) >>> /home/Amit/Myworkspace/MyApplicatio

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-30 Thread Amit Jain
David Chelimsky wrote: > On Jul 30, 2010, at 2:03 AM, Amit Jain wrote: > >>> rails. Please do this: >>> it using some means other than what is recommended by Rails, which is to >>> David >> (NameError) >> /home/Amit/Myworkspace/MyApplication/vendor/rails/activesupport/lib/active_support/dependenc

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-30 Thread David Chelimsky
On Jul 30, 2010, at 2:03 AM, Amit Jain wrote: > David Chelimsky wrote: >> On Jul 29, 2010, at 6:37 AM, Amit Jain wrote: >> >>> >>> and >>> >>> ~/mygreatapp/ $ ./script/plugin install >>> svn://rubyforge.org/var/svn/rspec/tags/REL_X_Y_Z/vendor/rspec_on_rails/vendor/plugins/rspec >> >> rspec_on

[rspec-users] Newbie : How to spec params hash amendment

2010-07-30 Thread Martin Hawkins
I am new to rspec and am finding it all a bit daunting at the moment. I'd like to be able to adopt a bdd approach to my development but I'm still at the stage of trying to get my head around rspec concepts so I'm committing the cardinal sin of coding first and then writing tests. I am using the fo

[rspec-users] Evaluating shared example customisation block before shared block

2010-07-30 Thread Ashley Moran
Hi I finally looked into why this is not currently possibly in RSpec 2 (beta 19): shared_examples_for "Etymology" do describe "The etymology of foo" do it "is followed by #{after_foo}" do # ... end end end describe "foo", focus: true do it_should_behave_like

Re: [rspec-users] proposition: warn on rake spec - group :test

2010-07-30 Thread Rainer Kuhn
That's not entirely true, there is a diffence between lot loaded and not defined, let me show you: This is without rspec in the dev group, so it does not show in rake - T: ~/work/myproject$ rake spec (in /Users/rainerkuhn/work/myproject) ~/work/myproject$ rake IdontExist (in /Users/rainerkuhn/wo

Re: [rspec-users] how to fix 'rake gems:refresh_specs' gems has no specificati

2010-07-30 Thread Amit Jain
David Chelimsky wrote: > On Jul 29, 2010, at 6:37 AM, Amit Jain wrote: > >> >> and >> >> ~/mygreatapp/ $ ./script/plugin install >> svn://rubyforge.org/var/svn/rspec/tags/REL_X_Y_Z/vendor/rspec_on_rails/vendor/plugins/rspec > > rspec_on_rails is 2 years old and works with 2 year old versions o