appjs 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be0a8f257901bb32bb81b7905ac61698404f6394
4
- data.tar.gz: 1a397bee83db324c160e798e46d800d633a26ee5
3
+ metadata.gz: a9810afd2cf377906af1dbb4e13d4f6bfa59c969
4
+ data.tar.gz: e30ed7e856937467d724175ed9b0ed9869f09266
5
5
  SHA512:
6
- metadata.gz: f6c9a425aab15924dc20c5971fe80b77c06033650128609dc7b3001bcf99ed6aa7030de44e845d482c9508d64145d088b4f6628d76697e41bbb852791814fe15
7
- data.tar.gz: 340ff2c1849a4a301a40a94bd17bfe1a63ca9bf9f3a367b40acad18ba86b534b8cd1b87849a9e6d5a88d6f4fc8d68470a3031bb9df301bee7a4d9f354edcfcd0
6
+ metadata.gz: f62b69874d096831bfe97f4fd17adec7094edc310fe4a583f552be6eb5b083bd98811d03ad6255330a62c4cb9e1487d8c57b38b91618b388aab00100db928c59
7
+ data.tar.gz: 1f4dcefd1b7e41a27b44a6c3d7650ffe9f9d16ce363faf5238ad6ffa2c70714e8d4fc5c734f08ceb68a0b09f516cf5556bf5802f74cece77963b3db9c9547eb7
@@ -1,3 +1,3 @@
1
1
  module Appjs
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -41,6 +41,10 @@ var App = function () {
41
41
  delete overwrites[constant];
42
42
  }
43
43
 
44
+ app.resetDefinitions = function () {
45
+ constants = {};
46
+ };
47
+
44
48
  return app;
45
49
  }
46
50
 
@@ -156,4 +156,30 @@ describe('app', function () {
156
156
  });
157
157
  });
158
158
 
159
+ describe('resetDefinitions', function () {
160
+ var namespace;
161
+
162
+ beforeEach(function () {
163
+ namespace = {};
164
+ App.induce(namespace);
165
+ });
166
+
167
+ it('removes all cached definiton instances', function () {
168
+ var count = 0
169
+
170
+ namespace.app.define('test', function () {
171
+ count += 1;
172
+ return count
173
+ });
174
+
175
+ assert.equal(namespace.app.require('test'), 1)
176
+ assert.equal(namespace.app.require('test'), 1)
177
+
178
+ namespace.app.resetDefinitions();
179
+
180
+ assert.equal(namespace.app.require('test'), 2)
181
+ assert.equal(namespace.app.require('test'), 2)
182
+ });
183
+ })
184
+
159
185
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakob Holderbaum