this library needs a better name

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

this library needs a better name

David Chelimsky-2
Hey guys,

I've got a little lib going named stubble. The name is a bad joke
about stubbing models. I'm looking for a better name.

Here's what it does. Instead of this:

      it "redirects to list of registrations" do
        registration = stub_model(Registration)
        Registration.stub!(:create).and_return(registration)
        registration.stub!(:save!).and_return(true)
        post 'create'
        response.should redirect_to(registrations_path)
      end

You can say this:

      it "redirects to list of registrations" do
        stubble(Registration)
        post 'create'
        response.should redirect_to(registrations_path)
      end

More examples here: http://gist.github.com/105857

The basic idea is that you use the stubble method to define a family
of stubs on a model class and the instance it returns for new(),
find(), create(), and create!(). There's a bit more than that, but
it's an infant right now, and there are certainly going to be holes in
it, but the biggest hole at the moment is its name :)

Thoughts?

Thanks,
David
_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

Mark Wilden
On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]> wrote:

The basic idea is that you use the stubble method to define a family
of stubs on a model class and the instance it returns for new(),
find(), create(), and create!(). There's a bit more than that, but
it's an infant right now, and there are certainly going to be holes in
it, but the biggest hole at the moment is its name :)

Since the library is for stubbing models, I actually like the name stubble.

///ark

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

Aslak Hellesoy


On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:
On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]> wrote:

The basic idea is that you use the stubble method to define a family
of stubs on a model class and the instance it returns for new(),
find(), create(), and create!(). There's a bit more than that, but
it's an infant right now, and there are certainly going to be holes in
it, but the biggest hole at the moment is its name :)

Since the library is for stubbing models, I actually like the name stubble.

Why not include it in rspec-rails?

Aslak
 

///ark

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

David Chelimsky-2
On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
<[hidden email]> wrote:

>
>
> On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:
>>
>> On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
>> wrote:
>>>
>>> The basic idea is that you use the stubble method to define a family
>>> of stubs on a model class and the instance it returns for new(),
>>> find(), create(), and create!(). There's a bit more than that, but
>>> it's an infant right now, and there are certainly going to be holes in
>>> it, but the biggest hole at the moment is its name :)
>>
>> Since the library is for stubbing models, I actually like the name
>> stubble.
>
> Why not include it in rspec-rails?

I may eventually, but I want to prove it out for a bit before adding
it to the mile long list of shit that I have to maintain in rspec
rails to maintain compatibility.

>
> Aslak
>
>>
>> ///ark
>>
>> _______________________________________________
>> rspec-devel mailing list
>> [hidden email]
>> http://rubyforge.org/mailman/listinfo/rspec-devel
>
>
> _______________________________________________
> rspec-devel mailing list
> [hidden email]
> http://rubyforge.org/mailman/listinfo/rspec-devel
>
_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

David Chelimsky-2
On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:

> On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
> <[hidden email]> wrote:
>>
>>
>> On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:
>>>
>>> On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
>>> wrote:
>>>>
>>>> The basic idea is that you use the stubble method to define a family
>>>> of stubs on a model class and the instance it returns for new(),
>>>> find(), create(), and create!(). There's a bit more than that, but
>>>> it's an infant right now, and there are certainly going to be holes in
>>>> it, but the biggest hole at the moment is its name :)
>>>
>>> Since the library is for stubbing models, I actually like the name
>>> stubble.
>>
>> Why not include it in rspec-rails?
>
> I may eventually, but I want to prove it out for a bit before adding
> it to the mile long list of shit that I have to maintain in rspec
> rails to maintain compatibility.

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

It needs to say "take control of this model class and provide
instances that are savable (or not) for find, new, create, and
create!" - all of that in one word.

Was chatting w/ imajes (James Cox) last night and I mentioned the word
stage, at which point we came up variations of this:

stage(Model).as :savable do |model|
  # access to the one and only model instance
end

Thoughts?


>
>>
>> Aslak
>>
>>>
>>> ///ark
>>>
>>> _______________________________________________
>>> rspec-devel mailing list
>>> [hidden email]
>>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>>
>> _______________________________________________
>> rspec-devel mailing list
>> [hidden email]
>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>
_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Fwd: this library needs a better name

David Chelimsky-2
Begin forwarded message:

From: David Chelimsky <[hidden email]>
Date: May 3, 2009 12:57:09 PM CDT
To: rspec-devel <[hidden email]>
Subject: Re: [rspec-devel] this library needs a better name

On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:
On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
<[hidden email]> wrote:


On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:

On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
wrote:

The basic idea is that you use the stubble method to define a family
of stubs on a model class and the instance it returns for new(),
find(), create(), and create!(). There's a bit more than that, but
it's an infant right now, and there are certainly going to be holes in
it, but the biggest hole at the moment is its name :)

Since the library is for stubbing models, I actually like the name
stubble.

Why not include it in rspec-rails?

I may eventually, but I want to prove it out for a bit before adding
it to the mile long list of shit that I have to maintain in rspec
rails to maintain compatibility.

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

It needs to say "take control of this model class and provide
instances that are savable (or not) for find, new, create, and
create!" - all of that in one word.

Was chatting w/ imajes (James Cox) last night and I mentioned the word
stage, at which point we came up variations of this:

stage(Model).as :savable do |model|
 # access to the one and only model instance
end

Thoughts?

Also also, goal is to make this framework agnostic - should be usable with t/u, any of its extensions, and the mock framework of your choosing.






Aslak


///ark

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel



_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: this library needs a better name

Aslak Hellesoy

Begin forwarded message:

From: David Chelimsky <[hidden email]>
Date: May 3, 2009 12:57:09 PM CDT
To: rspec-devel <[hidden email]>
Subject: Re: [rspec-devel] this library needs a better name

On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:
On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
<[hidden email]> wrote:


On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:

On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
wrote:

The basic idea is that you use the stubble method to define a family
of stubs on a model class and the instance it returns for new(),
find(), create(), and create!(). There's a bit more than that, but
it's an infant right now, and there are certainly going to be holes in
it, but the biggest hole at the moment is its name :)

Since the library is for stubbing models, I actually like the name
stubble.

Why not include it in rspec-rails?

I may eventually, but I want to prove it out for a bit before adding
it to the mile long list of shit that I have to maintain in rspec
rails to maintain compatibility.

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

It needs to say "take control of this model class and provide
instances that are savable (or not) for find, new, create, and
create!" - all of that in one word.

Was chatting w/ imajes (James Cox) last night and I mentioned the word
stage, at which point we came up variations of this:

stage(Model).as :savable do |model|
 # access to the one and only model instance
end

Thoughts?

Also also, goal is to make this framework agnostic - should be usable with t/u, any of its extensions, and the mock framework of your choosing.

I'm not sure I would have that as a goal. This is so close to underlying mocking and stubbing that abstracting away from it could make it too brittle.

Aslak
 






Aslak


///ark

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel



_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: this library needs a better name

David Chelimsky-2
On May 3, 2009, at 1:08 PM, aslak hellesoy <[hidden email]> wrote:


Begin forwarded message:

From: David Chelimsky <[hidden email]>
Date: May 3, 2009 12:57:09 PM CDT
To: rspec-devel <[hidden email]>
Subject: Re: [rspec-devel] this library needs a better name

On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:
On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
<[hidden email]> wrote:


On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:

On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
wrote:

The basic idea is that you use the stubble method to define a family
of stubs on a model class and the instance it returns for new(),
find(), create(), and create!(). There's a bit more than that, but
it's an infant right now, and there are certainly going to be holes in
it, but the biggest hole at the moment is its name :)

Since the library is for stubbing models, I actually like the name
stubble.

Why not include it in rspec-rails?

I may eventually, but I want to prove it out for a bit before adding
it to the mile long list of shit that I have to maintain in rspec
rails to maintain compatibility.

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

It needs to say "take control of this model class and provide
instances that are savable (or not) for find, new, create, and
create!" - all of that in one word.

Was chatting w/ imajes (James Cox) last night and I mentioned the word
stage, at which point we came up variations of this:

stage(Model).as :savable do |model|
 # access to the one and only model instance
end

Thoughts?

Also also, goal is to make this framework agnostic - should be usable with t/u, any of its extensions, and the mock framework of your choosing.

I'm not sure I would have that as a goal. This is so close to underlying mocking and stubbing that abstracting away from it could make it too brittle.

Yeah, yeah, yeah. First goal is to make it useful and pleasant. Still want to keep it separate from rspec-rails for the short terrm.



Aslak
 






Aslak


///ark

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel



_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

Mark Wilden
In reply to this post by David Chelimsky-2
On Sun, May 3, 2009 at 10:57 AM, David Chelimsky <[hidden email]> wrote:

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

stubblize(MyModel)

The contraction of "stub model" to "stubble" really speaks to me. :)

///ark

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

John Doxey
I love the idea.

I think "stubble" is a bit esoteric though, I almost prefer the example with two more lines of code, just for it's readability.

Having said that, I haven't been able to come up with a name myself :P
"stub_model" seems perfect, apart from the fact that it's already taken.



John Doxey



On Mon, May 4, 2009 at 6:11 AM, Mark Wilden <[hidden email]> wrote:
On Sun, May 3, 2009 at 10:57 AM, David Chelimsky <[hidden email]> wrote:

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

stubblize(MyModel)

The contraction of "stub model" to "stubble" really speaks to me. :)

///ark

_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

Dan North-2
In reply to this post by David Chelimsky-2
How about...

2009/5/4 David Chelimsky <[hidden email]>
On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:
> On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
> <[hidden email]> wrote:
>>
>>
>> On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:
>>>
>>> On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
>>> wrote:
>>>>
>>>> The basic idea is that you use the stubble method to define a family
>>>> of stubs on a model class and the instance it returns for new(),
>>>> find(), create(), and create!(). There's a bit more than that, but
>>>> it's an infant right now, and there are certainly going to be holes in
>>>> it, but the biggest hole at the moment is its name :)
>>>
>>> Since the library is for stubbing models, I actually like the name
>>> stubble.
>>
>> Why not include it in rspec-rails?
>
> I may eventually, but I want to prove it out for a bit before adding
> it to the mile long list of shit that I have to maintain in rspec
> rails to maintain compatibility.

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

pwn(MyModel)
 
It needs to say "take control of this model class and provide
instances that are savable (or not) for find, new, create, and
create!" - all of that in one word.

IN YR MODEL PWNING YR SAVEZ LOL!

KTHXBYE
 


Was chatting w/ imajes (James Cox) last night and I mentioned the word
stage, at which point we came up variations of this:

stage(Model).as :savable do |model|
 # access to the one and only model instance
end

Thoughts?


>
>>
>> Aslak
>>
>>>
>>> ///ark
>>>
>>> _______________________________________________
>>> rspec-devel mailing list
>>> [hidden email]
>>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>>
>> _______________________________________________
>> rspec-devel mailing list
>> [hidden email]
>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>
_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

John Doxey
pimp(MyModel)


On Mon, May 4, 2009 at 2:52 PM, Dan North <[hidden email]> wrote:
How about...

2009/5/4 David Chelimsky <[hidden email]>

On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:
> On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
> <[hidden email]> wrote:
>>
>>
>> On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:
>>>
>>> On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
>>> wrote:
>>>>
>>>> The basic idea is that you use the stubble method to define a family
>>>> of stubs on a model class and the instance it returns for new(),
>>>> find(), create(), and create!(). There's a bit more than that, but
>>>> it's an infant right now, and there are certainly going to be holes in
>>>> it, but the biggest hole at the moment is its name :)
>>>
>>> Since the library is for stubbing models, I actually like the name
>>> stubble.
>>
>> Why not include it in rspec-rails?
>
> I may eventually, but I want to prove it out for a bit before adding
> it to the mile long list of shit that I have to maintain in rspec
> rails to maintain compatibility.

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

pwn(MyModel)
 
It needs to say "take control of this model class and provide
instances that are savable (or not) for find, new, create, and
create!" - all of that in one word.

IN YR MODEL PWNING YR SAVEZ LOL!

KTHXBYE
 


Was chatting w/ imajes (James Cox) last night and I mentioned the word
stage, at which point we came up variations of this:

stage(Model).as :savable do |model|
 # access to the one and only model instance
end

Thoughts?


>
>>
>> Aslak
>>
>>>
>>> ///ark
>>>
>>> _______________________________________________
>>> rspec-devel mailing list
>>> [hidden email]
>>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>>
>> _______________________________________________
>> rspec-devel mailing list
>> [hidden email]
>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>
_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

Aslak Hellesoy
In reply to this post by Dan North-2


On Sun, May 3, 2009 at 9:52 PM, Dan North <[hidden email]> wrote:
How about...

2009/5/4 David Chelimsky <[hidden email]>

On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:
> On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
> <[hidden email]> wrote:
>>
>>
>> On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:
>>>
>>> On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
>>> wrote:
>>>>
>>>> The basic idea is that you use the stubble method to define a family
>>>> of stubs on a model class and the instance it returns for new(),
>>>> find(), create(), and create!(). There's a bit more than that, but
>>>> it's an infant right now, and there are certainly going to be holes in
>>>> it, but the biggest hole at the moment is its name :)
>>>
>>> Since the library is for stubbing models, I actually like the name
>>> stubble.
>>
>> Why not include it in rspec-rails?
>
> I may eventually, but I want to prove it out for a bit before adding
> it to the mile long list of shit that I have to maintain in rspec
> rails to maintain compatibility.

Also, a bigger problem than the lib name is the method. This doesn't
speak to me:

stubble(MyModel)

pwn(MyModel)
 

pr0n(MyModel)

? :-)
 

It needs to say "take control of this model class and provide
instances that are savable (or not) for find, new, create, and
create!" - all of that in one word.

IN YR MODEL PWNING YR SAVEZ LOL!

KTHXBYE
 


Was chatting w/ imajes (James Cox) last night and I mentioned the word
stage, at which point we came up variations of this:

stage(Model).as :savable do |model|
 # access to the one and only model instance
end

Thoughts?


>
>>
>> Aslak
>>
>>>
>>> ///ark
>>>
>>> _______________________________________________
>>> rspec-devel mailing list
>>> [hidden email]
>>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>>
>> _______________________________________________
>> rspec-devel mailing list
>> [hidden email]
>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>
_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel


_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

zdennis-2
In reply to this post by David Chelimsky-2
On Sun, May 3, 2009 at 1:57 PM, David Chelimsky <[hidden email]> wrote:

> On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:
>> On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
>> <[hidden email]> wrote:
>>>
>>>
>>> On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:
>>>>
>>>> On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
>>>> wrote:
>>>>>
>>>>> The basic idea is that you use the stubble method to define a family
>>>>> of stubs on a model class and the instance it returns for new(),
>>>>> find(), create(), and create!(). There's a bit more than that, but
>>>>> it's an infant right now, and there are certainly going to be holes in
>>>>> it, but the biggest hole at the moment is its name :)
>>>>
>>>> Since the library is for stubbing models, I actually like the name
>>>> stubble.
>>>
>>> Why not include it in rspec-rails?
>>
>> I may eventually, but I want to prove it out for a bit before adding
>> it to the mile long list of shit that I have to maintain in rspec
>> rails to maintain compatibility.
>
> Also, a bigger problem than the lib name is the method. This doesn't
> speak to me:
>
> stubble(MyModel)
>
> It needs to say "take control of this model class and provide
> instances that are savable (or not) for find, new, create, and
> create!" - all of that in one word.

I like "stub_model" for this as well even though its taken.  Based on
the name you pick, you will potentially need to change the name of
"stub_model", otherwise the API is going to become diluted and less
meaningful. Yes, I know it's one method, but stub_model doesn't do
what you think it does and this new behaviour does what I'd think
stub_model would do.

>
> Was chatting w/ imajes (James Cox) last night and I mentioned the word
> stage, at which point we came up variations of this:
>
> stage(Model).as :savable do |model|
>  # access to the one and only model instance
> end

stage doesn't do it for me. It seems like grasping for straws because
the good names have been taken. In your original post you already gave
two important words... it needs to "stub" stuff on the "model". What
else could be more clear?

>
> Thoughts?

You could keep existing "stub-model" behaviour and add on the new,
until the old is deprecated?

   stub_model(MyModel).as :savable


>
>
>>
>>>
>>> Aslak
>>>
>>>>
>>>> ///ark
>>>>
>>>> _______________________________________________
>>>> rspec-devel mailing list
>>>> [hidden email]
>>>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>>
>>>
>>> _______________________________________________
>>> rspec-devel mailing list
>>> [hidden email]
>>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>>
>>
> _______________________________________________
> rspec-devel mailing list
> [hidden email]
> http://rubyforge.org/mailman/listinfo/rspec-devel
>



--
Zach Dennis
http://www.continuousthinking.com (personal)
http://www.mutuallyhuman.com (hire me)
@zachdennis (twitter)
_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel
Reply | Threaded
Open this post in threaded view
|

Re: this library needs a better name

David Chelimsky-2
On Mon, May 11, 2009 at 8:07 PM, Zach Dennis <[hidden email]> wrote:

> On Sun, May 3, 2009 at 1:57 PM, David Chelimsky <[hidden email]> wrote:
>> On Sun, May 3, 2009 at 12:54 PM, David Chelimsky <[hidden email]> wrote:
>>> On Sun, May 3, 2009 at 12:40 PM, aslak hellesoy
>>> <[hidden email]> wrote:
>>>>
>>>>
>>>> On Sun, May 3, 2009 at 7:32 PM, Mark Wilden <[hidden email]> wrote:
>>>>>
>>>>> On Sat, May 2, 2009 at 11:12 PM, David Chelimsky <[hidden email]>
>>>>> wrote:
>>>>>>
>>>>>> The basic idea is that you use the stubble method to define a family
>>>>>> of stubs on a model class and the instance it returns for new(),
>>>>>> find(), create(), and create!(). There's a bit more than that, but
>>>>>> it's an infant right now, and there are certainly going to be holes in
>>>>>> it, but the biggest hole at the moment is its name :)
>>>>>
>>>>> Since the library is for stubbing models, I actually like the name
>>>>> stubble.
>>>>
>>>> Why not include it in rspec-rails?
>>>
>>> I may eventually, but I want to prove it out for a bit before adding
>>> it to the mile long list of shit that I have to maintain in rspec
>>> rails to maintain compatibility.
>>
>> Also, a bigger problem than the lib name is the method. This doesn't
>> speak to me:
>>
>> stubble(MyModel)
>>
>> It needs to say "take control of this model class and provide
>> instances that are savable (or not) for find, new, create, and
>> create!" - all of that in one word.
>
> I like "stub_model" for this as well even though its taken.  Based on
> the name you pick, you will potentially need to change the name of
> "stub_model", otherwise the API is going to become diluted and less
> meaningful. Yes, I know it's one method, but stub_model doesn't do
> what you think it does and this new behaviour does what I'd think
> stub_model would do.
>
>>
>> Was chatting w/ imajes (James Cox) last night and I mentioned the word
>> stage, at which point we came up variations of this:
>>
>> stage(Model).as :savable do |model|
>>  # access to the one and only model instance
>> end
>
> stage doesn't do it for me. It seems like grasping for straws because
> the good names have been taken. In your original post you already gave
> two important words... it needs to "stub" stuff on the "model". What
> else could be more clear?
>
>>
>> Thoughts?
>
> You could keep existing "stub-model" behaviour and add on the new,
> until the old is deprecated?
>
>   stub_model(MyModel).as :savable

Hey Zach,

Thanks for your thoughts on this but at this point I've already
announced the library name as stubble and the method it uses is
stubbing:

stubbing(Thing) do |thing|
  get :index
  assigns[:things].should == [thing]
end

More at http://github.com/dchelimsky/stubble/tree/master

Cheers,
David

>
>
>>
>>
>>>
>>>>
>>>> Aslak
>>>>
>>>>>
>>>>> ///ark
>>>>>
>>>>> _______________________________________________
>>>>> rspec-devel mailing list
>>>>> [hidden email]
>>>>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>>>
>>>>
>>>> _______________________________________________
>>>> rspec-devel mailing list
>>>> [hidden email]
>>>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>>>
>>>
>> _______________________________________________
>> rspec-devel mailing list
>> [hidden email]
>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
>
>
>
> --
> Zach Dennis
> http://www.continuousthinking.com (personal)
> http://www.mutuallyhuman.com (hire me)
> @zachdennis (twitter)
> _______________________________________________
> rspec-devel mailing list
> [hidden email]
> http://rubyforge.org/mailman/listinfo/rspec-devel
>
_______________________________________________
rspec-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-devel