uk-ar / el-spec

14 stars 1 forks source link

duplication with my project #1

Closed joelmccracken closed 12 years ago

joelmccracken commented 12 years ago

Hello!

I am working on something similar at the url:

https://github.com/joelmccracken/elspec

I'd like to figure out if we can/should collaborate. I haven't had the time to put much more effort than you see here into the project, but I certainly hope to do so, soon.

What are your goals for the project? Thanks!

uk-ar commented 12 years ago

Hello!

Thank you for your discovering my project. I also found your project after I wrote elisp. Basic concept is same as your project: A port of rspec using emacs lisp macro. I hope we can collaborate.

Impremented feature is

I wrote an documentation(https://github.com/uk-ar/el-spec/blob/master/README.md) so please read this document for details.

joelmccracken commented 12 years ago

Great! When I wrote this comment, the README was missing =)

I'll look over your code, see if mine currently does anything yours doesn't, and then merge it in/fork it. Is that acceptable? It seems like you are further along than I am, and I really don't have the time to work on this, myself.

The one thing that I want to do is to better support mocking than what was available with rubikitch's mocking library. Verifying that mocks were called correctly is exceedingly verbose, even with el-mock. Do you have any thoughts? The basic syntax I have been working with is:

 (mock :return-10 => 10 :should-call)

I was planning on building something like:

 (mock :add-3 => 23 :should-call-with (20))
uk-ar commented 12 years ago

Great! When I wrote this comment, the README was missing =)

To be honest, I wrote the README yesterday :P

The one thing that I want to do is to better support mocking than what was available with rubikitch's mocking library.

I basically agree that it should include mocking feature. And it is also better to choose another mocking libraly(e.g. el-mock.el)!

Verifying that mocks were called correctly is exceedingly verbose, even with el-mock. Do you have any thoughts? The basic syntax I have been working with is:

(mock :return-10 => 10 :should-call) I was planning on building something like:

(mock :add-3 => 23 :should-call-with (20))

I think that it is good idea to omit argument for mock. And verifying arguments and calling count became more readable with spies(https://github.com/btakita/rr/#spies)

(mock :return-10 => 10)
(return-10)
(shoud-called-times :return-10 1);=> t

(mock :add-3 => 23)
(add-3 20)
(add-3 19)
(shoud-called-with :add-3 20);=>t
(shoud-called-with :add-3 19);=>t

In addition, Mock macro's (and related macro) 1st argument should be required field instead of keyword argument for error handling and extention.

(mock :should-call => 10);; Is this ok for function which named should-call?

How about this?

joelmccracken commented 12 years ago

I like it, and what you propose works well with what I was thinking.

I have not used rr before, but it looks good. Jasmine (a Javascript testing framework) uses spies, and so I have used them quite a bit.

Okay. My next step is to download your code and try it out. After I do that, I'll update here.

uk-ar commented 12 years ago

I like it, and what you propose works well with what I was thinking.

I have not used rr before, but it looks good. Jasmine (a Javascript testing framework) uses spies, and so I have used them quite a bit.

Thank you for understanding.

I think it also should have primitive function args-for-call(like jasmine) so that we can implement another function.

(mock :add-3 => 23)
(args-for-call :add-3);=>()

(add-3 20)
(args-for-call :add-3);=>(20)

(add-3 19)
(args-for-call :add-3);=>(20,19)

Thus we can define should-called-times.

(should-called-times :return-10 1)
;;(should (eq (length (args-for-call :return-10) 1)))

Okay. My next step is to download your code and try it out. After I do that, I'll update here.

I am not good at English, So I would be really grateful to receive your feedbacks on README document and source code. Thanks.

joelmccracken commented 12 years ago

Okay, sorry for the delay on this.

I /totally/ want to help you still, I've just been busy with other things. I have read through most of the README (which is surprisingly long, good job!) and it looks fine. Some pieces are worded a little awkwardly, but I certainly wouldn't say that you weren't good at English. I'm probably going to try to get more feedback for you on this later today.

uk-ar commented 12 years ago

Thank you for your reading the README! And I'm sorry for delay.

Some pieces are worded a little awkwardly, but I certainly wouldn't say that you weren't good at English. I'm probably going to try to get more feedback for you on this later today.

It's absoutely no problem. I want your frank opinion.

I /totally/ want to help you still, I've just been busy with other things.

I want read your source code. So could you divide your mocking code from another code? (e.g. test context building code, test code, example code)

joelmccracken commented 12 years ago

I'll change the code for my "elspec" repository to highlight the mocking code.

Oh, and I did notice a few places with English errors. Should I fix them an submit a pull request?

On Thu, Sep 13, 2012 at 6:48 AM, yuuki arisawa notifications@github.comwrote:

Thank you for your reading the README! And I'm sorry for delay.

Some pieces are worded a little awkwardly, but I certainly wouldn't say that you weren't good at English. I'm probably going to try to get more feedback for you on this later today.

It's absoutely no problem. I want your frank opinion.

I /totally/ want to help you still, I've just been busy with other things.

I want read your source code. So could you divide your mocking code from another code? (e.g. test context building code, test code, example code)

— Reply to this email directly or view it on GitHubhttps://github.com/uk-ar/el-spec/issues/1#issuecomment-8524478.

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com

uk-ar commented 12 years ago

I'll change the code for my "elspec" repository to highlight the mocking code.

Thank you for agreeing to my proposal.

Oh, and I did notice a few places with English errors. Should I fix them an submit a pull request?

Of course, you are welcome! Please send me your pull request.

uk-ar commented 12 years ago

Hi! I tried imprementing mock framework as a prototype.Here is concept proof level source code. https://github.com/uk-ar/test-double/tree/ca17aa47f553db349a72dfdee025e7284304b8d0 You can use as following code.

;;; how to use
(require 'test-double)
(require 'ert)

 (with-mock2
  (defmock test3 (a b)
    (message "%d:%d" a b))
  (test3 1 2)
  (test3 3 4)
  (should (eq (el-spec:called-count 'test3) 2))
  (should (equal (el-spec:args-for-call 'test3) '((1 2) (3 4))))
  )

How about this?

joelmccracken commented 12 years ago

Looks fine! My first priority is getting around to looking into this.

joelmccracken commented 12 years ago

This looks great, and is fundamentally what I was doing. I suggest that the test-double repo be rename to el-mock and we can go from there.

uk-ar commented 12 years ago

I agree to rename test-double repo. But I want to avoid name conflict(el-mock.el,mocker.el). So I have following candidates.

How about these.

joelmccracken commented 12 years ago

what do you think of 'el-double'?

On Wed, Oct 3, 2012 at 1:26 PM, yuuki arisawa notifications@github.comwrote:

I agree to rename test-double repo. But I want to avoid name conflict(el-mock.el,mocker.el). So I have following candidates.

  • el-mocker
  • el2-mock
  • el-spec-mock
  • ert-mock How about these.

    — Reply to this email directly or view it on GitHubhttps://github.com/uk-ar/el-spec/issues/1#issuecomment-9114670.

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com

joelmccracken commented 12 years ago

I suggest this because generally a "double" is a more general mock, and since I'm not even sure if, technically, mocks even apply to emacs, since we don't use objects.

Unless, I guess, we were talking about testing with EIEIO, but we aren't.

On Wed, Oct 3, 2012 at 1:49 PM, Joel McCracken mccracken.joel@gmail.comwrote:

what do you think of 'el-double'?

On Wed, Oct 3, 2012 at 1:26 PM, yuuki arisawa notifications@github.comwrote:

I agree to rename test-double repo. But I want to avoid name conflict(el-mock.el,mocker.el). So I have following candidates.

  • el-mocker
  • el2-mock
  • el-spec-mock
  • ert-mock How about these.

    — Reply to this email directly or view it on GitHubhttps://github.com/uk-ar/el-spec/issues/1#issuecomment-9114670.

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com

uk-ar commented 12 years ago

I agree that "double" is more suitable for this package.But emacs attachs 'double.el' as key remapping package. So I want to make clear the difference between two package.

Any other ideas?

On 2012/10/04, at 2:58, Joel McCracken notifications@github.com wrote:

I suggest this because generally a "double" is a more general mock, and since I'm not even sure if, technically, mocks even apply to emacs, since we don't use objects.

Unless, I guess, we were talking about testing with EIEIO, but we aren't.

On Wed, Oct 3, 2012 at 1:49 PM, Joel McCracken mccracken.joel@gmail.comwrote:

what do you think of 'el-double'?

On Wed, Oct 3, 2012 at 1:26 PM, yuuki arisawa notifications@github.comwrote:

I agree to rename test-double repo. But I want to avoid name conflict(el-mock.el,mocker.el). So I have following candidates.

  • el-mocker
  • el2-mock
  • el-spec-mock
  • ert-mock How about these.

\ Reply to this email directly or view it on GitHubhttps://github.com/uk-ar/el-spec/issues/1#issuecomment-9114670.

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com \ Reply to this email directly or view it on GitHub.

joelmccracken commented 12 years ago

el-spy?

barring that, I like el-spec-mock

On Wed, Oct 3, 2012 at 7:00 PM, yuuki arisawa notifications@github.comwrote:

I agree that "double" is more suitable for this package.But emacs attachs 'double.el' as key remapping package. So I want to make clear the difference between two package.

Any other ideas?

On 2012/10/04, at 2:58, Joel McCracken notifications@github.com wrote:

I suggest this because generally a "double" is a more general mock, and since I'm not even sure if, technically, mocks even apply to emacs, since we don't use objects.

Unless, I guess, we were talking about testing with EIEIO, but we aren't.

On Wed, Oct 3, 2012 at 1:49 PM, Joel McCracken mccracken.joel@gmail.comwrote:

what do you think of 'el-double'?

On Wed, Oct 3, 2012 at 1:26 PM, yuuki arisawa < notifications@github.com>wrote:

I agree to rename test-double repo. But I want to avoid name conflict(el-mock.el,mocker.el). So I have following candidates.

  • el-mocker
  • el2-mock
  • el-spec-mock
  • ert-mock How about these.

\ Reply to this email directly or view it on GitHub< https://github.com/uk-ar/el-spec/issues/1#issuecomment-9114670>.

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com \ Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/uk-ar/el-spec/issues/1#issuecomment-9125501.

Joel McCracken http://joelmccracken.github.com 412-973-1864 skype: joelmccracken mccracken.joel@gmail.com

joelmccracken commented 12 years ago

Sweet! I just realize that this was still open and not about this. Closing this issue, for now.