Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Nick Hoffman
On 28/01/2009, at 12:16 PM, Pat Maddox wrote: If it doesn't automatically clone (it may, I don't know), it probably should provide a lambda syntax so you can do: default :subtitles => lambda { [] } Yeah, I just looked at the code for ARD and this is the problem. You can pass in immutable objec

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Nick Hoffman
On 28/01/2009, at 12:12 PM, Pat Maddox wrote: On Wed, Jan 28, 2009 at 8:30 AM, Nick Hoffman wrote: On 28/01/2009, at 7:50 AM, Zach Dennis wrote: On Tue, Jan 27, 2009 at 2:48 PM, Nick Hoffman wrote: G'day folks. I've been beating my head on this one problem for a couple of hours, and

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Pat Maddox
> If it doesn't automatically clone (it may, I don't know), it probably > should provide a lambda syntax so you can do: > default :subtitles => lambda { [] } Yeah, I just looked at the code for ARD and this is the problem. You can pass in immutable objects and they don't get affected for obvious

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Pat Maddox
On Wed, Jan 28, 2009 at 8:30 AM, Nick Hoffman wrote: > On 28/01/2009, at 7:50 AM, Zach Dennis wrote: >> >> On Tue, Jan 27, 2009 at 2:48 PM, Nick Hoffman wrote: >>> >>> G'day folks. I've been beating my head on this one problem for a couple >>> of >>> hours, and have managed to figure out what's c

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Nick Hoffman
On 28/01/2009, at 7:50 AM, Zach Dennis wrote: On Tue, Jan 27, 2009 at 2:48 PM, Nick Hoffman wrote: G'day folks. I've been beating my head on this one problem for a couple of hours, and have managed to figure out what's causing it. However, I don't understand why it's happening, nor do I kno

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-28 Thread Zach Dennis
On Tue, Jan 27, 2009 at 2:48 PM, Nick Hoffman wrote: > G'day folks. I've been beating my head on this one problem for a couple of > hours, and have managed to figure out what's causing it. However, I don't > understand why it's happening, nor do I know how to solve or get around it. > > One of my

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-27 Thread Nick Hoffman
On 27/01/2009, at 7:44 PM, David Chelimsky wrote: On Tue, Jan 27, 2009 at 1:48 PM, Nick Hoffman wrote: G'day folks. I've been beating my head on this one problem for a couple of hours, and have managed to figure out what's causing it. However, I don't understand why it's happening, nor do I

Re: [rspec-users] [RSpec] Cloning objects and leaking state

2009-01-27 Thread David Chelimsky
On Tue, Jan 27, 2009 at 1:48 PM, Nick Hoffman wrote: > G'day folks. I've been beating my head on this one problem for a couple of > hours, and have managed to figure out what's causing it. However, I don't > understand why it's happening, nor do I know how to solve or get around it. > > One of my

[rspec-users] [RSpec] Cloning objects and leaking state

2009-01-27 Thread Nick Hoffman
G'day folks. I've been beating my head on this one problem for a couple of hours, and have managed to figure out what's causing it. However, I don't understand why it's happening, nor do I know how to solve or get around it. One of my methods clones an arg, and it seems that doing so causes