Hacker News new | ask | show | jobs
by wiseleo 4370 days ago
It's a bit radical, but I am tempted to test it. :)

I am wiseleo on just about every website and gmail, so feel free to send me an instant message.

For me, seeing an executable test spec for the first time was very surprising and revealing. There is an entire book "Refactoring: improving the design of existing code" that teaches you how to name functions so your code reads like English.

After all, this is valid Jasmine from near the beginning of my test suite:

it("should return an array containing at least one object", function() { expect(menu.length).toBeGreaterThan(0); });

It reads like English. If you can show that code can be written like this rather than like typical code, you will notice an immediate jump in confidence.

If you show that in Rspec, where the alien-looking

function ( ) { };

is replaced with

  do
end

and expect('should do something useful') becomes expect "should do something useful"

it becomes even more approachable.