|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 - 3 | Next > |
|
|
Deprecating the mocking framework?I saw in one of Dave C.'s comments to a ticket that "our current plan
is to deprecate the mocking framework." I hadn't heard anything about that, but then again I haven't paid super close attention to the list. Are we planning on dumping the mock framework in favor of using Mocha (or any other framework one might want to plug in?). Pat _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?> I saw in one of Dave C.'s comments to a ticket that "our current plan
> is to deprecate the mocking framework." I hadn't heard anything about > that, but then again I haven't paid super close attention to the list. > Are we planning on dumping the mock framework in favor of using Mocha > (or any other framework one might want to plug in?). The idea has been banded around on the dev list recently, see..... http://www.nabble.com/mock-framework-tf4312137.html#a12276473 for the discussion Cheers Rupert _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 1 Sep 2007, at 09:31, rupert wrote:
>> Are we planning on dumping the mock framework in favor of using >> Mocha > The idea has been banded around on the dev list recently This makes me sad, because it means only one thing for the majority of users: more hassle. So now I have to choose a mocking framework too (an arbitrary choice, thus a gamble), or else configure RSpec to keep working the way it used to work, and watch my mocking code slide into obsolescence? Sigh. I agree that it's a big win for the RSpec developers to not have to deal with the distraction of maintaining a mocking framework, but it's vaguely surprising that nobody's mentioned how valuable it is that RSpec is a tidy, coherent, consistent, integrated BDD tool that just works out of the box right now. (And newcomers still find it impenetrable!) It looks like it's inevitable that it'll be broken up, but, yeah, it's a real shame. Cheers, -Tom _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?I understand where you're coming from Tom. But it's currently two
script/plugin installs to start using RSpec with Rails, making it be three (the current two plus a mocking framework) is presumably not going to change adoption or the hurdle of using RSpec by much. I currently use Mocha because I can use it both with Test::Unit and RSpec. I have a big legacy of Test::Unit tests and I want to be able to maintain those and use mocking there, with the same syntax as in RSpec. That's why I don't use the built in mocking in RSpec. Peter On Sep 1, 2007, at 11:04 AM, Tom Stuart wrote: > On 1 Sep 2007, at 09:31, rupert wrote: >>> Are we planning on dumping the mock framework in favor of using >>> Mocha >> The idea has been banded around on the dev list recently > > This makes me sad, because it means only one thing for the majority > of users: more hassle. So now I have to choose a mocking framework > too (an arbitrary choice, thus a gamble), or else configure RSpec to > keep working the way it used to work, and watch my mocking code slide > into obsolescence? Sigh. > > I agree that it's a big win for the RSpec developers to not have to > deal with the distraction of maintaining a mocking framework, but > it's vaguely surprising that nobody's mentioned how valuable it is > that RSpec is a tidy, coherent, consistent, integrated BDD tool that > just works out of the box right now. (And newcomers still find it > impenetrable!) It looks like it's inevitable that it'll be broken up, > but, yeah, it's a real shame. > > Cheers, > -Tom > _______________________________________________ > rspec-users mailing list > rspec-users@... > http://rubyforge.org/mailman/listinfo/rspec-users ---------------------------- Peter Marklund Garvar Lundins Gränd 7 11220 Stockholm Sweden Mobile Phone: +46-(0)70-4164857 Home Phone: +46-(0)8-50091315 Skype: peter_marklund IM: AIM - petermarklund, MSN - peter_marklund@..., Yahoo - peter_marklund2002 http://marklunds.com ---------------------------- _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 9/1/07, rupert <rupert_apsc@...> wrote:
> > I saw in one of Dave C.'s comments to a ticket that "our current plan > > is to deprecate the mocking framework." I hadn't heard anything about > > that, but then again I haven't paid super close attention to the list. > > Are we planning on dumping the mock framework in favor of using Mocha > > (or any other framework one might want to plug in?). > > The idea has been banded around on the dev list recently, see..... > > http://www.nabble.com/mock-framework-tf4312137.html#a12276473 > > for the discussion > > Cheers > > Rupert > > > _______________________________________________ > rspec-users mailing list > rspec-users@... > http://rubyforge.org/mailman/listinfo/rspec-users > Thanks for the link. Pat _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?El 1/9/2007, a las 11:15, Peter Marklund escribió:
> I understand where you're coming from Tom. But it's currently two > script/plugin installs to start using RSpec with Rails, making it be > three (the current two plus a mocking framework) is presumably not > going to change adoption or the hurdle of using RSpec by much. I > currently use Mocha because I can use it both with Test::Unit and > RSpec. I have a big legacy of Test::Unit tests and I want to be able > to maintain those and use mocking there, with the same syntax as in > RSpec. That's why I don't use the built in mocking in RSpec. Ouch. I used the built-in RSpec mocking because it was the default and I figured that it would be less likely to have compatibility issues in the future (say when Mocha or any of the others made subtle updates outside the control of the RSpec team). I liked the idea of having one integrated package which just worked. I actually thought the trend was in the opposite direction; to include things in RSpec (isn't RBehave part of trunk now?) rather than pare them down. Luckily, however, I don't have too many mocks yet, and the ones which are there aren't that complex. Could probably convert them over to something else in about a day's work. Cheers, Wincent _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 1 Sep 2007, at 10:04, Tom Stuart wrote: > On 1 Sep 2007, at 09:31, rupert wrote: >>> Are we planning on dumping the mock framework in favor of using >>> Mocha >> The idea has been banded around on the dev list recently > > This makes me sad, because it means only one thing for the majority > of users: more hassle. So now I have to choose a mocking framework > too (an arbitrary choice, thus a gamble), or else configure RSpec to > keep working the way it used to work, and watch my mocking code slide > into obsolescence? Sigh. It won't be removed, so you'll still be able to use it (as Peter pointed out) . I had exactly the same initial reaction as you (mine was a sort of "nooooo, they can't do that") so I know where you're coming from. But having read through the discussion on the dev list and thought about it, the rspec mocking framework is pretty stable and complete so I don't think depreciating it is going to be too big a problem for those (like me!) that have a bundle of specs that use the rspec mocking framework - I'm going to keep using it for now, but have a look at the alternatives as a background task with the intent to use one of them on a new project as some point in the future. Cheers Rupert _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?My question is what would you recommend for Mocking?
Mocha or FlexMock? On 9/1/07, rupert <rupert_apsc@...> wrote:
_______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 1 Sep 2007, at 18:16, Andrew WC Brown wrote: > My question is what would you recommend for Mocking? > > Mocha or FlexMock? Personally, I've not got a clue as all I've used to date is the rspec mocking framework. I've had a quick look at Mocha and it seems pretty good, but haven't looked into FlexMock at all yet. +1 to anyone who's used both these can comment on the differences! _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?After a quick google search:
http://www.slideshare.net/viget/mockfight-flexmock-vs-mocha I have no problem using a external mocking framework but its the choosing. convention over configuration. On 9/1/07, rupert <rupert_apsc@...> wrote:
-- Monsterbox Productions putting small businesses on-line 1319 Victoria Avenue East Thunder Bay, Ontario P7C 1C3 Canada Andrew WC Brown web-developer and owner andrew@... P: 807-626-9009 F: 807-624-2705 _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 9/1/07, Andrew WC Brown <omen.king@...> wrote:
> After a quick google search: > > http://www.slideshare.net/viget/mockfight-flexmock-vs-mocha In fairness - there is something lacking in the slide set - it suggests that mocha supports parameter matchers and flexmock does not. In fact, flexmock does. You can do this: mock.should_receive(:message).with(String).once and it will pass if the mock receives the message w/ a String. In mocha, you have to say: mock.expects(:message).with(kind_of(String)) Flexmock compares args using ===, which is why this works implicitly. Similarly, mocha, flexmock, and rspec can all take an argument matcher - an object that responds to == and gives you the right answer. So, you can do this w/ any of these frameworks: class LessThan def initialize(threshold) @threshold = threshold end def ==(other) other < @threshold end end def less_than(expected) LessThan.new(expected) end mock.expects(:message).with(less_than(3)) mock.should_receive(:message).with(less_than(3)) Cheers, David > > I have no problem using a external mocking framework but its the choosing. > convention over configuration. > > > > On 9/1/07, rupert <rupert_apsc@...> wrote: > > > > On 1 Sep 2007, at 18:16, Andrew WC Brown wrote: > > > > > My question is what would you recommend for Mocking? > > > > > > Mocha or FlexMock? > > > > Personally, I've not got a clue as all I've used to date is the rspec > > mocking framework. I've had a quick look at Mocha and it seems > > pretty good, but haven't looked into FlexMock at all yet. > > > > +1 to anyone who's used both these can comment on the differences! > > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users@... > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > -- > Monsterbox Productions > putting small businesses on-line > > 1319 Victoria Avenue East > Thunder Bay, Ontario P7C 1C3 > Canada > > Andrew WC Brown > web-developer and owner > andrew@... > P: 807-626-9009 > F: 807-624-2705 > _______________________________________________ > rspec-users mailing list > rspec-users@... > http://rubyforge.org/mailman/listinfo/rspec-users > rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 9/1/07, rupert <rupert_apsc@...> wrote:
> > On 1 Sep 2007, at 10:04, Tom Stuart wrote: > > > On 1 Sep 2007, at 09:31, rupert wrote: > >>> Are we planning on dumping the mock framework in favor of using > >>> Mocha > >> The idea has been bandied around on the dev list recently This decision, if it is made in this manner, is suicide for RSpec. I have been a huge RSpec booster, but this will make me drop it like a hot coal. =( _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 9/1/07, Wilson Bilkovich <wilsonb@...> wrote:
> On 9/1/07, rupert <rupert_apsc@...> wrote: > > > > On 1 Sep 2007, at 10:04, Tom Stuart wrote: > > > > > On 1 Sep 2007, at 09:31, rupert wrote: > > >>> Are we planning on dumping the mock framework in favor of using > > >>> Mocha > > >> The idea has been bandied around on the dev list recently > > This decision, if it is made in this manner, is suicide for RSpec. > I have been a huge RSpec booster, but this will make me drop it like a hot coal. > =( While I won't drop RSpec ;) I agree that removing the mocking framework is a mistake. With the integration of rbehave, RSpec is a complete BDD framework. It allows for behavior specification at the app-level and at the object-level. I'm sure everyone will agree that mocking is integral to the object specification component of BDD. To paraphrase Aslak, "if you're not using mock objects then it ain't BDD." I can understand not wanting to reinvent the wheel, and there are mock frameworks that sufficiently do the job. However the whole point of RSpec is that we're not satisfied with "sufficient" but instead demand a tool that works the way our brains think. I haven't used Mocha or Flexmock extensively because RSpec's mocking has been great for me...but I remember taking a look at them when Mocha support was first added to RSpec. There were some things that RSpec's framework did better and more clearly than Mocha. I wish I could remember them precisely, but it was quite a while back. The point is, if the mock framework feels off even a little bit, it basically defeats the purpose of RSpec. At the very least, it undermines it to a degree. RSpec should keep its mocking framework because it's the only framework that is designed with the same philosophy as RSpec. In fact I feel insanely strange thinking of them as separate entities. The best scenario, imo, is one where we have a mocking framework tightly coupled to the overall vision of the RSpec project, but that allows people to use something else if they really want. I think it's important that RSpec remain a complete BDD framework with all necessary components working in harmony. Pat _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 9/2/07, Wilson Bilkovich <wilsonb@...> wrote:
> On 9/1/07, rupert <rupert_apsc@...> wrote: > > > > On 1 Sep 2007, at 10:04, Tom Stuart wrote: > > > > > On 1 Sep 2007, at 09:31, rupert wrote: > > >>> Are we planning on dumping the mock framework in favor of using > > >>> Mocha > > >> The idea has been bandied around on the dev list recently > > This decision, if it is made in this manner, is suicide for RSpec. > I have been a huge RSpec booster, but this will make me drop it like a hot coal. > =( > _______________________________________________ > rspec-users mailing list > rspec-users@... > http://rubyforge.org/mailman/listinfo/rspec-users > Eh! The first reactions :-) However I also have to admit and wonder why rspec dev didn't make this kind of decisions before version 1.0. I hate (as a nuby) that now I have to make decision (mocka or flexmock) at the time where I'm not even a big mock fan yet (now it's even more harder to sell the idea to co-workers as well). For the very first look, I prefer mocka syntax more than flexmock. However I like rspec's clean it 'should' specs (and generating doc from it) so much more compared to test::unit way is. Oki, Priit _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 9/2/07, Wilson Bilkovich <wilsonb@...> wrote:
> On 9/1/07, rupert <rupert_apsc@...> wrote: > > > > On 1 Sep 2007, at 10:04, Tom Stuart wrote: > > > > > On 1 Sep 2007, at 09:31, rupert wrote: > > >>> Are we planning on dumping the mock framework in favor of using > > >>> Mocha > > >> The idea has been bandied around on the dev list recently > > This decision, if it is made in this manner, is suicide for RSpec. I simply don't understand this statement. Why is this such a big deal? RSpec's mock framework offers pretty much ZERO over mocha or flexmock - the only thing is that it saves you from typing 24 or 27 characters in a config file, depending on your preference. 21 if you use RR. After that, the functionality is pretty much the same as the other frameworks. > I have been a huge RSpec booster, but this will make me drop it like a hot coal. Again - I can't understand where you're coming from here. If you start using test/unit or test/spec or any of the other bdd frameworks you'll still need to make a decision about a mock framework. What is the pain that you're perceiving that will come along w/ us dumping the mock framework? Perhaps there's something we can do to minimize that pain once we know what it is. Cheers, David > =( > _______________________________________________ > rspec-users mailing list > rspec-users@... > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On Sep 2, 2007, at 12:55 PM, David Chelimsky wrote: > On 9/2/07, Wilson Bilkovich <wilsonb@...> wrote: >> On 9/1/07, rupert <rupert_apsc@...> wrote: >>> >>> On 1 Sep 2007, at 10:04, Tom Stuart wrote: >>> >>>> On 1 Sep 2007, at 09:31, rupert wrote: >>>>>> Are we planning on dumping the mock framework in favor of using >>>>>> Mocha >>>>> The idea has been bandied around on the dev list recently >> >> This decision, if it is made in this manner, is suicide for RSpec. > > I simply don't understand this statement. Why is this such a big deal? > RSpec's mock framework offers pretty much ZERO over mocha or flexmock > - the only thing is that it saves you from typing 24 or 27 characters > in a config file, depending on your preference. 21 if you use RR. > > After that, the functionality is pretty much the same as the other > frameworks I'm a little confused about this discussion. Why don't we just do the following: 1. Hand off the mocking/stubbing framework off to someone else. It will be their project 2. Make the mocking/stubbing framework a dependency of the rspec gem 3. Make it the default (as it is now) 4. Provide clear directions for changing mocking frameworks (as we have now). I thought the end goal with refactoring the mocking framework out was not that we shouldn't be using it, but, that we (David, Aslak, Brian, etc) won't have to maintain it. Or am I missing something? Scott _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?I think that makes sense.
Which do you recommend? Flexmock or Mocha? On 9/2/07, Scott Taylor <mailing_lists@...> wrote:
-- Monsterbox Productions putting small businesses on-line 1319 Victoria Avenue East Thunder Bay, Ontario P7C 1C3 Canada Andrew WC Brown web-developer and owner andrew@... P: 807-626-9009 F: 807-624-2705 _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?On 9/2/07, Scott Taylor <mailing_lists@...> wrote:
> > On Sep 2, 2007, at 12:55 PM, David Chelimsky wrote: > > > On 9/2/07, Wilson Bilkovich <wilsonb@...> wrote: > >> On 9/1/07, rupert <rupert_apsc@...> wrote: > >>> > >>> On 1 Sep 2007, at 10:04, Tom Stuart wrote: > >>> > >>>> On 1 Sep 2007, at 09:31, rupert wrote: > >>>>>> Are we planning on dumping the mock framework in favor of using > >>>>>> Mocha > >>>>> The idea has been bandied around on the dev list recently > >> > >> This decision, if it is made in this manner, is suicide for RSpec. > > > > I simply don't understand this statement. Why is this such a big deal? > > RSpec's mock framework offers pretty much ZERO over mocha or flexmock > > - the only thing is that it saves you from typing 24 or 27 characters > > in a config file, depending on your preference. 21 if you use RR. > > > > After that, the functionality is pretty much the same as the other > > frameworks > > I'm a little confused about this discussion. Why don't we just do > the following: > > 1. Hand off the mocking/stubbing framework off to someone else. It > will be their project > > 2. Make the mocking/stubbing framework a dependency of the rspec gem > > 3. Make it the default (as it is now) > > 4. Provide clear directions for changing mocking frameworks (as we > have now). > > I thought the end goal with refactoring the mocking framework out was > not that we shouldn't be using it, but, that we (David, Aslak, Brian, > etc) won't have to maintain it. Or am I missing something? Well, it's not simply a matter of US maintaining it. It's a matter of it being maintained at all in light of the fact that mocha and flexmock exist. Put simply, there never should have been an rspec mock framework. But here we are. In my view, we either put the thing to sleep or keep it part of rspec and forget the whole deprecation thing. Handling it off to someone else to maintain seems silly to me. FWIW, David > > Scott > > > > _______________________________________________ > rspec-users mailing list > rspec-users@... > http://rubyforge.org/mailman/listinfo/rspec-users > rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?>
> Well, it's not simply a matter of US maintaining it. It's a matter of > it being maintained at all in light of the fact that mocha and > flexmock exist. Put simply, there never should have been an rspec mock > framework. > > But here we are. > > In my view, we either put the thing to sleep or keep it part of rspec > and forget the whole deprecation thing. Handling it off to someone > else to maintain seems silly to me. > > FWIW, > David Ah. I had no idea. Why was it originally created, then? Were you guys not happy with mocha at the time? I find it hard to believe that you were ignorant about it. Plus - are you going to change all of rspec's specs to use flexmock or mocha? Scott _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
|
|
Re: Deprecating the mocking framework?>
> Well, it's not simply a matter of US maintaining it. It's a matter of > it being maintained at all in light of the fact that mocha and > flexmock exist. Put simply, there never should have been an rspec mock > framework. > > But here we are. > > In my view, we either put the thing to sleep or keep it part of rspec > and forget the whole deprecation thing. Handling it off to someone > else to maintain seems silly to me. Just to reiterate on my last point: There are some advantages to keeping the framework - namely that we won't have to convert a lot of specs. But there are other advantages, too. New features are easier for us to implement for ourselves. I've already had some ideas for how the mocking framework could become better (i.e. support for anonymous functions). I think if we keep it, we should be looking to implement some of those advantages that the other mocking frameworks don't have. We also have steam, which I don't think mocha and flexmock have (although I could be wrong about this). I just took a look at flexmock - and must say that I don't like the "partial mock" language, because it is confusing to my brain which distinguishes a stub from a mock. And mocha/stubba has an ugly syntax (In my humble, and inexperienced, opinion). If you did "put the thing [rspec's mocking framework] to sleep" - which would you covert to - Mocha, or Flexmock? Scott _______________________________________________ rspec-users mailing list rspec-users@... http://rubyforge.org/mailman/listinfo/rspec-users |
| < Prev | 1 - 2 - 3 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |