title: Why can't nested describe() blocks see vars defined in outer blocks?
body: <p>I've run into this issue in real code, but I put together a trivial example to prove the point.</p>
  
  <p>The below code works fine. I've set up a variable in my root <code>describe()</code> block that is accessible within my sub-<code>describe()</code>s' <code>it()</code> blocks.</p>
  
  <pre><code>describe('simple object', function () {
      var orchard;
  
      beforeEach(function () {
          orchard = {
              trees: {
                  apple: 10,
                  orange : 20
              },
              bushes: {
                  boysenberry : 40,
                  blueberry: 35
              }
          };
      });
  
      describe('trees', function () {
          it ('should have apples and oranges', function() {
              var trees = orchard.trees;
  
              expect (trees.apple).toBeDefined();
              expect (trees.orange).toBeDefined();
  
              expect (trees.apple).toEqual(10);
              expect (trees.orange).toEqual(20);
          });
          it ('should NOT have pears or cherries', function() {
              var trees = orchard.trees;
  
              expect (trees.pear).toBeUndefined();
              expect (trees.cherry).toBeUndefined();
          });
      });
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/w5bzrkh9/" rel="noreferrer">http://jsfiddle.net/w5bzrkh9/</a></p>
  
  <p>However, if I try to DRY up my code a little by doing the following, it breaks:</p>
  
  <pre><code>describe('simple object', function () {
      var orchard;
  
      beforeEach(function () {
          orchard = {
              trees: {
                  apple: 10,
                  orange : 20
              },
              bushes: {
                  boysenberry : 40,
                  blueberry: 35
              }
          };
      });
  
      describe('trees', function () {
          var trees = orchard.trees; // TypeError: Cannot read property 'trees' of undefined
  
          it ('should have apples and oranges', function() {
              expect (trees.apple).toBeDefined();
              expect (trees.orange).toBeDefined();
  
              expect (trees.apple).toEqual(10);
              expect (trees.orange).toEqual(20);
          });
          it ('should NOT have pears or cherries', function() {
              expect (trees.pear).toBeUndefined();
              expect (trees.cherry).toBeUndefined();
          });
      });
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/goqcev42/" rel="noreferrer">http://jsfiddle.net/goqcev42/</a></p>
  
  <p>Within the nested <code>describe()</code> scope, the <code>orchard</code> object is undefined, even though it's defined within the <code>it()</code> blocks within it.</p>
  
  <p>Is this intentional on the part of Jasmine's developers, possibly to avoid issues with resetting the object in <code>beforeEach()</code> and possible breaking some references?  How do they make it happen? I could see how this might be useful, I'm just very curious as to how it works. (My guess is some <code>apply()</code> or <code>call()</code> magic, but I'm not sure how...)</p>
  
  <p>--</p>
  
  <p>As a side-note, I can still DRY up my code by simply using another <code>beforeEach()</code> block:</p>
  
  <pre><code>describe('simple object', function () {
      var orchard;
  
      beforeEach(function () {
          orchard = {
              trees: {
                  apple: 10,
                  orange : 20
              },
              bushes: {
                  boysenberry : 40,
                  blueberry: 35
              }
          };
      });
  
      describe('trees', function () {
          var trees;
  
          beforeEach(function() {
              trees = orchard.trees;
          });
  
          it ('should have apples and oranges', function() {
              expect (trees.apple).toBeDefined();
              expect (trees.orange).toBeDefined();
  
              expect (trees.apple).toEqual(10);
              expect (trees.orange).toEqual(20);
          });
          it ('should NOT have pears or cherries', function() {
              expect (trees.pear).toBeUndefined();
              expect (trees.cherry).toBeUndefined();
          });
      });
  });
  </code></pre>