HN user

mattsah

57 karma
Posts10
Comments25
View on HN

It'd likely be possible to come up with that information using git, but I don't think github has an interface for it. If it makes you feel better I'll probably be starting a site with the repository at some point which would reflect that, i.e. allow you to search for recipes with commits by a certain author via parsing git blame output.

Right now I just want to build the repo.

I couldn't get the article to load, but given that it's Bill Gates, I assume this has something to do with the spread of HIV/AIDS.

From the commments I can discern that one concern is reducing pleasure. I'd imagine the condoms used in third-world country are not high-end super thin condoms which make the experience a bit better, but the really rubbery thick ones you can get for free at a high school sex class.

That said, is this really about building a better condom? Or just building a better condom, cheaper?

Also, I'm not sure this is the primary problem. You'd probably be better of spending $100,000 on fighting the catholic church to make sure condoms, even the cheap kind, are widely available.

No one has a "right" not to be offended insofar as such would trump any right to freedom of speech. That said, any company under the current circumstances has a "right" to fire an employee who might afford them negative attention one way or the other, and certainly under the conditions of sexual harassment.

Please note, I am not saying that I agree the company should have done so, merely that they likely have the right.

I completely agree with this, and the documentation will be forthcoming on the GitHub wiki - so please follow and keep and eye out. There will also be an article at some point soon on Nettuts which will give a pretty complete example of it mimicking a new object instantiation to resolve a static dependency on an example class being tested.

In 99% of cases I would wager you don't want your stubs to perform much logic at all. You want their returns to be a static as possible. The more logic your stubs perform the greater chance your test may fail due to an error in your test logic.

This is purposeful. The point of passing the original mime object in two-fold. It is first that it allows you to manipulate the object further when and only when the method is called. This is extremely useful for mocking/stubbing very dynamic objects whose behavior may change based on a method call. Secondly, it allows you to return the mimicked object.

Think of a method, for example that might expect two arguments, set a number of properties, and then return itself. Now imagine it has a second method, which may also alter one of those properties and return something else completely. This is pretty straightforward to do with parody:

    Mime::create('Vendor\Project\Class')
        ->onCall('method1')->expect('arg1', 2)->give(function($mime) {
            $mime->onGet('property1')->give('totally');
            $mime->onGet('property2')->give('possible');

            return $mime;
        })
        ->onCall('method2')->give(function($mime) {
            $mime->onGet('property1')->give('new value');

            return TRUE;
        });
I am not readily familiar with the syntax of other frameworks... but this seems a lot more flexible than passing arguments to the callback and forcing untested logic into the callbacks.

As I mentioned in another comment -- this is designed for very strict and context sensitive test cases. In principle, everything you should ever expect when calling a method is to give something and get something back, and maybe that it modifies a property. All of this is possible here, the logic of how it transforms what you get to what it gives is irrelevant, you should know the answer to both as a developer. And by removing that logic from the code, you "fake" only the very explicit expectations of the code you're pretending to be.

I'm not sure why you would have a test function in the main app as opposed to separate testing - but yes, it would.

The intention of the AGPL is clear in my opinion and not really up for author interpretation. If someone is accessing code on a server (binary or interpreted), they have a right to obtain and modify that source code.

Aside from SaaS testing suites, I do not know of any examples where test code is accessed by users over a network.

It is, thus, 100% OK to use this source code to test a closed source project.

If the GPL had the same added clause as the AGPL, then there would be a serious number of infringing web apps.

The first sentence of the wikipedia page explains it best: "Both versions of the AGPL were designed to close a perceived application service provider "loophole" (the "ASP loophole") in the ordinary GPL, where by using but not distributing the software, the copyleft provisions are not triggered."

No use == no copyleft requirement, and I would hope it's pretty clear that simply by having a piece of AGPL software in the same directory as another piece of software that it is not inherently using it.

I tried to clarify above.

What I am trying to get at is that traditionally web software is not distributed at all. That is, the software itself is never provided to the user and the user just interfaces with it externally.

The point regarding binary stuff was as it applies to distributed projects because if PHP or any other interpreted language is "distributed" in a traditional sense, it is already in source code.

I feel as though the confusion here is because people are looking at the initial distribution to other developers and thinking that's it. But that distribution completely allows for a developer to "link to it", modify it, and keep it behind closed doors if it is never distributed. And it isn't if it's sitting behind a web server... someone is just interfacing with it through a completely open protocol.

The point of the AGPL is to say that someone who is using a program, regardless of the fact that the program itself is never being distributed to them, has a right to get the source.

I'm not sure I follow. Could you give a hypothetical example?

It's difficult to tell if you are only referring to the passing of the original Mime as an argument... which if you are, I presume is more a limitation of documentation. While it may be clever, it's a pretty standard use of callbacks to have arguments passed to them that may be useful inside.

I misspoke, what I should have said is that GPL's distribution clause only pertains to binary software.

clearly if you provide someone a piece of GPL software (such as a perl script to do something useful on their server) it's GPL so it's free software and it's already source code.

The point is that the Affero clause is very clearly targets software that is being used over a network connection rather than being distributed.

It is not possible in the least that the "semantics of the communication are intimate enough" to qualify -- the semantics of the communication are HTTP, an open standard used for extremely varied purposes.

I'm quite sure the MySQL guys are simply wrong on that, but even if they're not, it's clearly not the case for HTTP.

Expectations and responses (provided by give()) are actually held internally. Your syntax is cleaner for very simple responses, however will become increasingly complex, particularly when the response itself is determined by a callback. Adding more params would clutter your example terribly. Also, the mime's are passed to callbacks which provide response so that additional functionality can be added, see this recent use-case:

Parody\Mime::create('App\Text') -> onCall('create') -> expect('WTF' . DS . 'Yo') -> give(function($mime) { return $mime -> onCall('underscorize') -> give('wtf' . DS . 'yo') -> resolve(); });

GPL does not "infect" a whole project either.

GPL only requires you distribute source if you distribute the binary.

It is designed so that users maintain the right to modify software that they use.

The only difference with the Aferro clause is that it considers network use of web software to be distribution and pertains to obfuscated software (i.e. server side source) even if it's not binary.

Let me clarify, I don't think anyone's projects that are web facing actually use their testing library to perform the tasks. So for all intents and purposes their projects as they are "distributed" over a network are not linking to it even though it may exist in their source tree.

The only exception to this would be if the project is actually for testing, like say an online service that tests your code.

Also any private non-distributed use does not require source distribution.

Nope. If the project actually uses tests for its function and it is accessible they would be required to provide the source to anyone user who requested it.

Much like the regular GPL, AGPL is dependent on distribution.

If you create a project that uses it to perform testing on the project, unless your testing is a function of the actual project then you wouldn't have to do anything of the sorts.

If you created a testing platform online that used it to render services, then you would, yes.

I'm cool with that. Feel free to move the example.php into a separate subdirectory to make it cleaner too, but please fix the includes to point to whatever relative directory need be.

I wrote this library for two major reasons:

1) To avoid the complexity of existing frameworks. 2) To be able to quickly and easily test code with various kinds of dependencies.

It is predominately designed to test a single class in an extremely isolated context, not in the context of a full blown testing framework.

It is designed to be a stupid as possible with the intention of allowing the developer (myself) to define very strict test condition and very fine grain control.