Anonymous function in Coffeescript how to test it
I know there's a lot of discussions in Stackoverflow about this one, but I couldn't get a straight answer about that. And I don't know much of coffeescript. 

Basically, I have this coffeescript

<code>
return42 = ->
	42
</code>

And when I compile I get this
<pre>
<code>
(function() {
  var return42;

  return42 = function() {
    return 42;
  };

}).call(this);
</code>
</pre>

So the function it's wrapped in the anonymous function which it's not exposed to the world. So when I write this test

<pre>
<code>
describe "Test number", ->
	it "is 42", ->
		expect(return42()).toBe 42
</code>
</pre>

The test would fail because return42() is undefined. How could I solve this. 

Thank you very much. :-)
Anonymous function in Coffeescript how to test it
===

I know there's a lot of discussions in Stackoverflow about this one, but I couldn't get a straight answer about that. And I don't know much of coffeescript. 

Basically, I have this coffeescript

<code>
return42 = ->
	42
</code>

And when I compile I get this
<pre>
<code>
(function() {
  var return42;

  return42 = function() {
    return 42;
  };

}).call(this);
</code>
</pre>

So the function it's wrapped in the anonymous function which it's not exposed to the world. So when I write this test

<pre>
<code>
describe "Test number", ->
	it "is 42", ->
		expect(return42()).toBe 42
</code>
</pre>

The test would fail because return42() is undefined. How could I solve this. 

Thank you very much. :-)