Re: [rspec-users] Stubbing Enumerable#each

2007-08-06 Thread Pat Maddox
On 8/5/07, Scott Taylor [EMAIL PROTECTED] wrote: I have a mock of an instance of a class which descends from Array: class ArrayDescendent Array; end #... in the specs... @descendent = mock ArrayDescendent How would I stub out ArrayDescendent#each, which is inherited from Array, to

[rspec-users] using RSpec's trunk in non-rails projects w/ Autotest

2007-08-06 Thread Scott Taylor
I believe for rails projects you can put rspec's code repos into vendor/plugins, and autotest will automatically use the rspec binary in that directory, and not the gem installed. Is there an easy way to do this for non-rails projects? There are a few advancements on trunk which I would

Re: [rspec-users] pending w/ no string

2007-08-06 Thread David Chelimsky
On 8/6/07, Scott Taylor [EMAIL PROTECTED] wrote: Is there some reason that pending() *MUST* take an argument? There was no discussion of this when the feature was contributed. Thinking about it now, to allow for no arg would require good default messages - one for when there is a block and one

Re: [rspec-users] pending w/ no string

2007-08-06 Thread Scott Taylor
On Aug 6, 2007, at 7:19 AM, David Chelimsky wrote: On 8/6/07, Scott Taylor [EMAIL PROTECTED] wrote: Is there some reason that pending() *MUST* take an argument? There was no discussion of this when the feature was contributed. Thinking about it now, to allow for no arg would require good

Re: [rspec-users] pending w/ no string

2007-08-06 Thread David Chelimsky
On 8/6/07, Scott Taylor [EMAIL PROTECTED] wrote: On Aug 6, 2007, at 7:19 AM, David Chelimsky wrote: On 8/6/07, Scott Taylor [EMAIL PROTECTED] wrote: Is there some reason that pending() *MUST* take an argument? There was no discussion of this when the feature was contributed.

[rspec-users] Specifying custom rails FormBuilders

2007-08-06 Thread Jay Levitt
I want to write a spec for a custom form builder, but I'm not really sure where it should live or how to include the right rspec_on_rails contexts. Ideally, I should be able to write a spec like: describe LabelledBuilder do it should let me create a text field do object = mock(object)

Re: [rspec-users] Problems with array mock

2007-08-06 Thread Gaston Ramos
El lun, 06 de ago de 2007, a las 11:52:28 -0500, David Chelimsky dijo: On 8/6/07, Gaston Ramos [EMAIL PROTECTED] wrote: Hi everyone, I'm trying this in my helper spec and it didn't work: @curr_odontogram.should_receive('photos[1]').and_return(@photo) and the error is:

Re: [rspec-users] Problems with array mock

2007-08-06 Thread David Chelimsky
On 8/6/07, aslak hellesoy [EMAIL PROTECTED] wrote: @curr_odontogram.photos.should_receive(:[]).with(1).and_return(@photo) Aslak D'oh! Of course - that should do it. ___ rspec-users mailing list rspec-users@rubyforge.org

[rspec-users] used the described Class in a shared behavior

2007-08-06 Thread ben
Is it possible to access the described class in a shared behavior? I'm trying to do something like this: describe Siberian feline, :shared = true do described_class_instance_as :feline, :name = fluffy, :breed = Siberian # or maybe before(:all) do @feline = described_class.new(:name =

Re: [rspec-users] used the described Class in a shared behavior

2007-08-06 Thread David Chelimsky
On 8/6/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/6/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is it possible to access the described class in a shared behavior? I'm trying to do something like this: describe Siberian feline, :shared = true do described_class_instance_as

[rspec-users] Object equality with a DSL

2007-08-06 Thread Scott Taylor
How would you spec a DSL which descends from Jim Weirich's Blank Slate? I'm asking this question because I have written a DSL, and would like to have the DSL class descend from BlankSlate so that methods like == are not available in the DSL itself (in production), but only while Testing.